访问URL时出现无效参数错误

2024-03-29 14:31:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我不太会拉网。我刚刚下载了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版本是:versionón 80.0.3987.149(Build of icial)(64位)


Tags: the代码fromimporturlreleasedriver错误
1条回答
网友
1楼 · 发布于 2024-03-29 14:31:24

召唤

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

不是有效的URL。它必须像https://www.pccomponentes.com/portatiles一样

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

相关问题 更多 >