本文僅供學習交流使用,如侵立刪! |
Selenium獲取請求頭、響應頭
操作環(huán)境
- win10 、 mac
- Python3.9
- selenium、seleniumwire
selenium是沒有辦法直接獲取請求的詳細Headers,很多時候我們我們是需要提取相關的參數來做進一步使用比如token之類的,這里推薦使用一個SeleniumWire模塊來達到目的
Selenium-wire模塊介紹
Selenium-wire官方文檔
安裝:pip install selenium-wire
項目介紹
Selenium Wire 擴展了 Selenium 的 Python 綁定,讓您可以訪問瀏覽器發(fā)出的底層請求。 您編寫代碼的方式與編寫 Selenium 的方式相同,但您會獲得額外的 API 來檢查請求和響應并動態(tài)更改它們。文章來源:http://www.zghlxwxcb.cn/news/detail-404277.html
Compatibilty文章來源地址http://www.zghlxwxcb.cn/news/detail-404277.html
- Python 3.6+
- Selenium 3.4.0+
- Chrome, Firefox and Remote Webdriver supported
到了這里,關于【】Selenium獲取請求頭、響應頭的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!