0.10 Beta10 Update
This commit is contained in:
@@ -12,33 +12,24 @@ else:
|
||||
|
||||
def get_html(url):#网页请求核心
|
||||
if not str(config['proxy']['proxy']) == '':
|
||||
proxies = {
|
||||
"http" : "http://" + str(config['proxy']['proxy']),
|
||||
"https": "https://" + str(config['proxy']['proxy'])
|
||||
}
|
||||
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3100.0 Safari/537.36'}
|
||||
getweb = requests.get(str(url), headers=headers, proxies=proxies)
|
||||
getweb.encoding = 'utf-8'
|
||||
# print(getweb.text)
|
||||
try:
|
||||
proxies = {"http": "http://" + str(config['proxy']['proxy']),
|
||||
"https": "https://" + str(config['proxy']['proxy'])}
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3100.0 Safari/537.36'}
|
||||
getweb = requests.get(str(url), timeout=10, headers=headers, proxies=proxies)
|
||||
getweb.encoding = 'utf-8'
|
||||
# print(getweb.text)
|
||||
try:
|
||||
return getweb.text
|
||||
except:
|
||||
print('[-]Connected failed!:Proxy error')
|
||||
return getweb.text
|
||||
except:
|
||||
aaaa=''
|
||||
#print('[-]Connect Failed.')
|
||||
|
||||
|
||||
print('[-]Connected failed!:Proxy error')
|
||||
else:
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'}
|
||||
getweb = requests.get(str(url), headers=headers)
|
||||
getweb.encoding = 'utf-8'
|
||||
try:
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'}
|
||||
getweb = requests.get(str(url), timeout=10, headers=headers)
|
||||
getweb.encoding = 'utf-8'
|
||||
try:
|
||||
return getweb.text
|
||||
except:
|
||||
print("[-]Connect Failed.")
|
||||
return getweb.text
|
||||
except:
|
||||
aaaa = ''
|
||||
#print('[-]Connect Failed.')
|
||||
print("[-]Connect Failed.")
|
||||
Reference in New Issue
Block a user