前言
发现在网上分享的链接需要一个一个提取很麻烦,所以写了一个脚本
代码
#! /usr/bin/env python
# _*_ coding:utf-8 _*_
from requests import session
from bs4 import BeautifulSoup
import csv
import codecs
import re
import time
import json
def login(email,passwd,isproxies):
url="https://xxx.com/auth/login"
data={
'email':email,'passwd':passwd}
proxies = {
"http": "http://127.0.0.1:8090",
"https": "http://127.0.0.1:8090",
}
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36'
}
if isproxies:
r=sess.post(url,data,headers=headers,proxies=proxies,verify=False)
else:
r = sess.post(url, data, headers=headers, verify=False)
def pa(isproxies):
url="https://xxx.com/user/node"
proxies = {
"http": "http://127.0.0.1:8090",
"https": "http://127.0.0.1:8090",
}
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36'
}
if isproxies:
r=sess.get(url,headers=headers,proxies=proxies,verify=False)
else: