0
import mechanicalsoup

proxies = {
    "http": "socks5://127.0.0.1:49260",
    "https": "socks5://127.0.0.1:49260"
}
url = 'https://whatismyip.com/'
browser = mechanicalsoup.StatefulBrowser()

browser.session.proxies = proxies   # This seem can't work

page = browser.open(url)  #, verify=False
print(page)
print(page.text)

我尝试通过使用mechanicalsoup向我的webbot添加代理,但这不起作用,官方文档没有提到这一点,关于这个的工作演示在哪里?谢谢

4

0 回答 0