第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如何訪問(wèn)鏈接并在其上停留特定的秒數(shù)?

如何訪問(wèn)鏈接并在其上停留特定的秒數(shù)?

犯罪嫌疑人X 2023-10-05 16:46:55
我在停留在網(wǎng)站鏈接上時(shí)遇到問(wèn)題,該鏈接有一個(gè)停留計(jì)時(shí)器,并且不會(huì)移動(dòng)到其他地方。這是我的代碼:import requestsimport timefrom bs4 import BeautifulSoupurl = input('Please enter your link: ')def get_response(url, method='GET'):    response = requests.request(method, url, headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win32; x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"}, timeout=15)    text_response = response.text    status_code = response.status_code    return[status_code, text_response]while True:    (status_code, text_response) = get_response(url)    parse_data = BeautifulSoup(text_response, 'html.parser')    time.sleep(20)    print('done')    exit()該鏈接將打開(kāi),但不像在瀏覽器中那樣
查看完整描述

1 回答

?
蕪湖不蕪

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超7個(gè)贊

計(jì)時(shí)器在網(wǎng)站上的 Javascript 代碼上運(yùn)行,requests庫(kù)不運(yùn)行網(wǎng)站的 Javascript 代碼。

使用Selenium代替,它允許您控制瀏覽器并運(yùn)行網(wǎng)站的 Javascript。


查看完整回答
反對(duì) 回復(fù) 2023-10-05
  • 1 回答
  • 0 關(guān)注
  • 108 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)