【问题标题】:Invalid argument error when accessing URL访问 URL 时出现无效参数错误
【发布时间】:2020-06-30 13:34:22
【问题描述】:

我是网络抓取的新手。我刚刚下载了 chromedriver:Current stable release: ChromeDriver 80.0.3987.106.

现在,我开始编写代码,但在尝试访问我想要的 URL 时出现错误。请看下面的代码和错误。

from selenium import webdriver
from bs4 import BeautifulSoup
import pandas as pd

#Set path to chromedriver
driver = webdriver.Chrome('C:/webdrivers/chromedriver.exe')

#Open the URL where I will perform the webscraping
driver.get("< a href=https://www.pccomponentes.com/portatiles")

显示的错误如下:

InvalidArgumentException: Message: invalid argument
  (Session info: chrome=80.0.3987.149)

我的 Chrome 版本是:版本 80.0.3987.149(官方版本)(64 位)。

【问题讨论】:

    标签: python html google-chrome web-scraping


    【解决方案1】:

    打电话给

    driver.get("< a href=https://www.pccomponentes.com/portatiles")
    

    不是有效的 URL。一定是https://www.pccomponentes.com/portatiles

    driver.get("https://www.pccomponentes.com/portatiles")
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-18
      • 2018-07-05
      • 2012-08-28
      • 1970-01-01
      • 2017-09-23
      • 1970-01-01
      相关资源
      最近更新 更多