Chromedriver从特定站点获取数据时行为异常

时间:2019-02-28 10:12:12

标签: python python-3.x selenium selenium-webdriver web-scraping

我已经用python与硒结合编写了一个脚本,以解析网站上的前100个名称。当我运行脚本时,会弹出一个通知框/警告框。

  

这里可能是个问题,因为我使用相同的方法已经有一段时间了,而在不同的站点中没有任何问题吗?

website url

from selenium import webdriver

def collect_names(driver,link):
    driver.get(link)
    for item in driver.find_elements_by_css_selector(".topcolumn h2"):
        print(item.text)

if __name__ == '__main__':
    url = "https://propertyspark.com/top-100-real-estate-teams-on-social-media-in-2018/"
    driver = webdriver.Chrome()
    collect_names(driver,url)
    driver.quit()

弹出框: enter image description here

以下是问题签名:

  Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: chromedriver.exe
  Application Version:  0.0.0.0
  Application Timestamp:    5a9904fa
  Fault Module Name:    chromedriver.exe
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp:   5a9904fa
  Exception Code:   c0000005
  Exception Offset: 0003c586
  OS Version:   6.1.7601.2.1.0.256.1
  Locale ID:    1033
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

1 个答案:

答案 0 :(得分:1)

似乎您最近已经升级了浏览器,因此还需要升级driver.exe以获得兼容性。

settings.scss

Download chrome Driver exe