小编use*_*411的帖子

Python Scrapy:TypeError:to_bytes必须接收unicode,str或bytes对象,得到int

我不知道这段代码有什么问题.我正在尝试从99acres.com抓取数据.我已经通过了帖子参数.这是代码

from scrapy import Spider
from scrapy.http import FormRequest
from scrapy.selector import HtmlXPathSelector


class aagSpider(Spider):
    name = "acre"
    start_urls = ["http://www.99acres.com"]

    def parse(self, response):
        frmdata3 = {"Refine_Localities": "Refine Localities", "action": "/do/quicksearch/search", "bedroom_num": "",
                    "budget_max": "", "budget_min": "", "city": 4,
                    "class": "", "fullSelectedSuggestions": "laxmi nagar, delhi east", "isvoicesearch": "N",
                    "keyword": "",
                    "keyword_suggest": "laxmi nagar, delhi east;",
                    "locality_array[]": "233",
                    "locality_array[]": "233",
                    "locality_array[]": "233",
                    "lstAcn": "HP_R",
                    "lstAcnId": "0",
                    "np_search_type": "NL,NP,R2M",
                    "preference": "S",
                    "property_type": "23",
                    "refine_results": "Y",
                    "res_com": "R",
                    "search_location": "HP",
                    "search_type": "QS",
                    "searchform": …
Run Code Online (Sandbox Code Playgroud)

python typeerror scrapy

8
推荐指数
1
解决办法
5223
查看次数

根据字典的键中断字典列表而不会丢失顺序

考虑清单

temp=[
{'white': ['BlackRock Institutional Trust Company, N.A.  400 Howard Street  San Francisco, CA 94105-2618', ' ', '1,741,814', '', ' ', ' ', ' 6.85%', ' ']},
{'white': ['The Banc Funds Co, LLC  20 North Wacker Drive    Suite 3300  Chicago, IL 60606-3105', ' ', '1,447,529', '', ' ', ' ', ' 5.69%', ' ']}, 
{'blue': ['James B. Miller, Jr.', ' ', '3,413,249', '', '(1)     ', ' ', '13.40%', ' ']}, 
{'blue': ['Major General (Ret) David R. Bockel', ' ', '41,471', …
Run Code Online (Sandbox Code Playgroud)

python dictionary list

2
推荐指数
1
解决办法
75
查看次数

标签 统计

python ×2

dictionary ×1

list ×1

scrapy ×1

typeerror ×1