import requests
from selenium import webdriver
import time
class JzSpider:
def __init__(self,):
self.start_url = "http://radar.itjuzi.com//company"
self.headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36",
"Accept":"Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"Connection": "keep - alive",
"Accept-Encoding":"gzip, deflate, br"}
def parse_url(self,url):
proxies = {"http": "http://117.127.0.204:8080"}
response = requests.get(url, headers=self.headers)
content = response.content.decode("utf-8")
return content
def save_content_list(self,content):
with open("Jz.txt", "w", encoding="utf-8") as f:
f.write(content)
print("")
def run(self):
driver = webdriver.Chrome()
-sharp driver.get()403ipip
driver.get("https://www.itjuzi.com/user/login?flag=radar&redirect=/company")
driver.find_element_by_id("create_account_email").send_keys("13333331328")
driver.find_element_by_id("create_account_password").send_keys("lz133333333334")
time.sleep(8)
driver.find_element_by_id("login_btn").click()
html_str = self.parse_url(self.start_url)
self.save_content_list(html_str)
if name ="_ _ main__":
Jz_spider = JzSpider()
Jz_spider.run()