Home > other >  Scrapy under the framework of a magical mistake, make sure you haven't met!!!!!!!!!!!!!!!!!!!!!
Scrapy under the framework of a magical mistake, make sure you haven't met!!!!!!!!!!!!!!!!!!!!!

Time:10-04

Scrapy under the framework of a magical mistake, make sure you haven't met
With scrapy crawl data and written to a local CSV, as long as there is a line of code crawler file
[item [' p ']=data. The find (class_='price'). The find (class_='price_n'). The text]
Crawl when will an error
[the File "c: \ program files \ python37-32 \ lib \ encodings \ MBCS py", line 25, encode in
Return mbcs_encode (input, the self. Errors) [0]
UnicodeEncodeError: 'MBCS' codec can 't encode characters in the position 0-1: invalid charact]
Eventually lead to local CSV file is written to failure, can only be written to a header, solving?
Heavily to solve?

CodePudding user response:

After add the line, print (item) is what things? The item is normal?

CodePudding user response:

The item inside you define P this field yet
  • Related