簡體   English   中英

如何從代理站點轉換 document.write 的輸入。 我可以用python解碼的東西

[英]How to convert the inputs of a document.write from a proxy site. To something i can decode in python

我正在嘗試從網站上抓取代理列表。 給定網站上代理的端口數據執行包含以下內容的腳本。

document.write(":"+(ZeroFiveSevenFive^FiveSevenOne)+(Eight5EightFour^Seven3Zero))

在瀏覽器中,顯示字符串:80

如果您在像 StackOverflow 這樣的網頁上打開的控制台中運行該命令。 它返回

VM36:1 Uncaught ReferenceError: Zero1EightZero is not defined
    at <anonymous>:1:21

我想要的是將我從美麗的湯設置中獲得的'(ZeroFiveSevenFive^FiveSevenOne)+(Eight5EightFour^Seven3Zero)'字符串輸入某種 Python 函數並返回:80

正如@Barmar 所建議的,而不是 python requests 庫,我使用了 selenium 並執行了腳本並得到了我期望的答案。

driver.execute_script('document.write(document.write(":"+(ZeroFiveSevenFive^FiveSevenOne)+(Eight5EightFour^Seven3Zero)))

暫無
暫無

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

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