【发布时间】:2021-11-17 12:54:50
【问题描述】:
嗨,我是网络抓取的初学者,我刚刚学习 scrapy。当我尝试在scrapy shell中使用这种类型的url时,它总是显示一个错误如何绕过它
scrapy shell https://www.yellowpages.com/search?search_terms=software+engineer&geo_location_terms=Glendale%2C+CA
At line:1 char:79
+ ... ://www.yellowpages.com/search?search_terms=software+engineer&geo_loca ...
+ ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : AmpersandNotAllowed
乱码
import scrapy
class YellowSpider(scrapy.Spider):
name = 'yellow'
allowed_domains = ['yellowpages.com']
start_urls = ['https://www.yellowpages.com/search?search_terms=software+engineer&geo_location_terms=Glendale%2C+CA']
def parse(self, response):
pass
【问题讨论】:
标签: python web-scraping scrapy screen-scraping