def start_PhantomJS():
uaList = []
for line in open('Base_Data\\Ualist.txt'):
uaList.append(line[:-1])
open('Base_Data\\Ualist.txt').close()
i = random.choice(uaList)
headers = {
'Accept':'*/*',
'Accept-Language':'zh-CN,zh;q=1',
'User-Agent': i,
'Connection': 'keep-alive'
}
service_args = [
#'--proxy=127.0.0.1:9999',
#'--proxy-type=http',
'--ignore-ssl-errors=true',
]
for key,value in headers.items():
webdriver.DesiredCapabilities.PHANTOMJS['phantomjs.page.customHeaders.{}'.format(key)] = value
webdriver.DesiredCapabilities.PHANTOMJS['phantomjs.page.settings.userAgent'] = i
dr = webdriver.PhantomJS(executable_path=r'C:\\Users\\sorano\\Desktop\\???????\\Asuna Sword\\bin\\phantomjs.exe',service_args=service_args)
return dr,uaList
评论列表
文章目录