Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 像互联网百科全书一样抓取许多页面:Selenium错误、HTML表抓取_Python_Selenium_Selenium Webdriver_Web Crawler_Selenium Chromedriver - Fatal编程技术网

Python 像互联网百科全书一样抓取许多页面:Selenium错误、HTML表抓取

Python 像互联网百科全书一样抓取许多页面:Selenium错误、HTML表抓取,python,selenium,selenium-webdriver,web-crawler,selenium-chromedriver,Python,Selenium,Selenium Webdriver,Web Crawler,Selenium Chromedriver,我正在制作这些百科全书页面的爬虫程序,其中有一些Selenium和表源爬虫错误 首先,在这些葡萄酒百科全书中有超过10万的内容,所以我使用了“for”。 其次,该爬虫程序必须打开并爬网每个详细页面,以便 我尝试使用Selenium chrome驱动程序。 第三,详细页面中的表没有id或类名,所以我编写了这些代码。 当我运行这个爬虫程序时,chrome页面上没有内容,这些代码也不起作用 driver = webdriver.Chrome('./chromedriver.exe') req1 =

我正在制作这些百科全书页面的爬虫程序,其中有一些Selenium和表源爬虫错误

首先,在这些葡萄酒百科全书中有超过10万的内容,所以我使用了“for”。 其次,该爬虫程序必须打开并爬网每个详细页面,以便 我尝试使用Selenium chrome驱动程序。 第三,详细页面中的表没有id或类名,所以我编写了这些代码。 当我运行这个爬虫程序时,chrome页面上没有内容,这些代码也不起作用

 driver = webdriver.Chrome('./chromedriver.exe')
req1 = requests.get('https://terms.naver.com/list.nhn?cid=48159&categoryId=48159&page={}'.format(page))
driver.get(req1)
driver.implicitly_wait(5)
selenium和表爬行代码

TypeError回溯(最近一次调用上次) 在() 28 driver=webdriver.Chrome('./chromedriver.exe') 29 req1=requests.get({}.format(第页)) --->30驱动程序。获取(需求1)
31驱动程序。隐式等待(5)

我认为您的
print
语句中的错误是
位于
'
标记之外,而不是内部。试着这样做,看看是否有效:

print('type: ', one, 'use: ', two)

tr.find('td')。find('a')文本
应该是
tr.find('td')。find('a')。文本
!谢谢,但还是不行。谢谢,我修好了。但我的代码中仍然有一些错误。@fairystarlight-是的,我可以在你编辑的问题中看到。但新的错误类型(由selenium生成)与原始问题中的错误类型(由Python生成)不同。一般来说,SO倾向于原始问题保持原样,新错误作为单独的问题发布。
print('type: ', one, 'use: ', two)