Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https代理使用? #762

Open
chenying99 opened this issue Aug 17, 2023 · 1 comment
Open

https代理使用? #762

chenying99 opened this issue Aug 17, 2023 · 1 comment

Comments

@chenying99
Copy link

chenying99 commented Aug 17, 2023

请问https代理是这么使用吗?

import requests

def get_proxy():
    return requests.get("http://127.0.0.1:5010/get/?type=https").json()  # 添加参数?type=https

def delete_proxy(proxy):
    requests.get("http://127.0.0.1:5010/delete/?proxy={}".format(proxy))

然后下面requests使用:

html = requests.get('http://www.example.com', proxies={"http": "http://{}".format(proxy)})

应该修改为?

html = requests.get('http://www.example.com', proxies={"https": "http://{}".format(proxy)})

还是两个http都要修改为https?

html = requests.get('http://www.example.com', proxies={"https": "https://{}".format(proxy)})
@jhao104
Copy link
Owner

jhao104 commented Aug 21, 2023

html = requests.get('http://www.example.com', proxies={"https": "https://{}".format(proxy), "http": "https://{}".format(proxy)})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants