簡體   English   中英

使用 python 解析時無法檢索用戶名

[英]Unable to retrieve username while parsing with python

下面是我的代碼片段:

#from bs4 import BeautifulSoup
import requests

session = requests.Session()

payload = {'user': 'user@comcast.net',
          'passwd': 'password'}

s = session.post("https://login.xfinity.com/", data=payload)

s = session.get('https://customer.xfinity.com/#/?CMP=ILC_signin_myxfinity_re')

#soup = BeautifulSoup(s.text, 'html.parser')
print(s.text)

執行上述代碼后,我將嘗試從 s.text 中檢索用戶名。 但它不攜帶我登錄 xfinity 帳戶時出現的用戶名。

只有當我使用瀏覽器手動登錄帳戶時,我才能看到用戶名。 如何檢索我需要的所有信息? PS:1.我確實嘗試了圖書館“webbot”。 但這不是我在我的代碼中使用的偏好。 我願意使用“請求”之類的庫。 2. 我也試過其他網站,我也遇到同樣的錯誤

考慮到我的 web 應用程序在 IE 以外的任何瀏覽器中都不兼容,我目前找不到解決方案來實現這一點。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM