记录下
以前:
import socket
import socks
from requests_html import HTMLSession
session=HTMLSession()
socks.set_default_proxy(socks.SOCKS5, "127.0.0.1", 1080)
socket.socket = socks.socksocket
url = "https://www.google.co.jp"
print(session.get(url).text)
现在:
from requests_html import HTMLSession
session = HTMLSession()
proxy = {"http": "socks5://127.0.0.1:1080","https": "socks5://127.0.0.1:1080"}
url = "https://www.google.co.jp"
req = session.get(url, proxies=proxy)
print(req.text)