嗨,我是网页抓取的初学者。当我尝试在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
把url用引号括起来:
scrapy shell "https://www.yellowpages.com/search?search_terms=software+engineer&geo_location_terms=Glendale%2C+CA"