【发布时间】:2021-09-13 11:55:33
【问题描述】:
这是我的代码:
import requests
from bs4 import BeautifulSoup
Url = "https://gmail.com"
R = requests.get(Url)
Soup = BeautifulSoup(R.text,"lxml")
print(Soup)
但我需要我的 cookie、登录数据和其他东西,它们存储在 google chrome 中,所以我想通过 google chrome 获取 url。
谷歌浏览器的路径:“C:\Program Files\Google\Chrome\Application\chrome.exe”
这可能吗?谢谢...
【问题讨论】:
-
如果你想使用浏览器打开一个网址...使用浏览器。如果你想用给定的 url 打开一个浏览器,把它叫做“path_to_chrome_exe url”......但是如果你想使用带有 chrome cookie 的请求,看看here
-
@Sr.S 嗯那么我怎么能在这段代码上做到这一点?其实我还有别的想法。
-
请看一下我发布的网址。有一些例子。
-
@Sr.S 谢谢,但他们不适合这个项目
标签: python html beautifulsoup lxml