1
何度もリクエスト投稿機能を使用しています。私は理由を知りませんが、今私は1つのWebサイトにログインすることはできません:私がしようとすると、その後リクエストでのログイン投稿
# Import
from requests import Session
from bs4 import BeautifulSoup
# Core settings
HEADERS = {
"User-Agent": "Mozilla/5.0"}
s = Session()
response = s.get("https://suite.searchmetrics.com/en/auth/login", headers=HEADERS)
soup = BeautifulSoup(response.text, "lxml")
redirect_url = soup.select('input[id="id_redirect_data"]')[0].get("value")
data = {"redirect_url": redirect_url,
"mail": "[email protected]",
"password": "abcfeFD"}
s.post("https://suite.searchmetrics.com/en/auth/authenticate", data=data, headers=HEADERS)
:
content_url = "https://suite.searchmetrics.com/en/research?url=wsj.com"
response = s.get(content_url, headers=HEADERS)
soup1 = BeautifulSoup(response.text, "lxml")
print(soup1.prettify())
私は
あなたが '' –
を「/ EN /認証/認証」するためにあなたのデータを提出しなければならない私はsuite.searchmetrics.com/en/auth/authenticateするためにそれを変更しましたが、それは私の作品 – edyvedy13
を動作するようには思えません。投稿を現在のコードで更新できますか? –