06 2019 档案
摘要:1 # -*- coding:utf-8 -*- 2 import requests,json 3 4 class RunMain(): 5 # def __init__(self,url,method,data=None,headers=None): 6 # self.res = self.run_main(url,method,data,headers)...
阅读全文
摘要:1 #在元素定位二次封装的基础上,封装判断元素是否可见,找到元素时返回True,找不到元素的时候抛出异常,返回False 2 def isElementPresent(self,locate_type,value): 3 try: 4 self.findElement(locate_type,value) 5 return True 6 except ...
阅读全文
摘要:1 # -*- coding: utf-8 -*- 2 3 import urllib.request 4 5 import json 6 import gzip 7 8 cityname = input('请输入你想查询的城市:\n') 9 10 # 访问的url,其中urllib.parse.quote是将城市名转换为url的组件 11 url = 'http://...
阅读全文
摘要:1 import re 2 import os 3 import requests 4 from time import sleep 5 6 headers = { 7 "User-Agent": ("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) " 8 "Gecko/2010...
阅读全文
摘要:1 # coding:utf8 2 from multiprocessing.dummy import Pool as ThreadPool 3 import multiprocessing 4 import requests, os, codecs, time 5 from lxml import etree 6 7 url = 'https://www.biquge5200....
阅读全文

浙公网安备 33010602011771号