【发布时间】:2020-08-13 00:40:57
【问题描述】:
我正在使用 selenium webdriver 尝试从 realestate.com.au 抓取信息,这是我的代码:
从 selenium.webdriver 导入 Chrome 从 bs4 导入 BeautifulSoup
path = 'C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe'
url = 'https://www.realestate.com.au/buy'
url2 = 'https://www.realestate.com.au/property-house-nsw-castle+hill-134181706'
webdriver = Chrome(path)
webdriver.get(url)
soup = BeautifulSoup(webdriver.page_source, 'html.parser')
print(soup)
它适用于 URL,但是当我尝试打开 url2 时,它会打开一个空白页面,我检查控制台得到以下信息: “加载资源失败:服务器响应状态为 429 () about:blank:1 加载资源失败:net::ERR_UNKNOWN_URL_SCHEME 149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/fingerprint:1 加载资源失败:服务器响应状态为404()"
在打开 URL 时,我尝试搜索任何内容,这也导致出现 url2 之类的空白页面。
【问题讨论】:
标签: python selenium selenium-webdriver scrape