MCPcopy Index your code
hub / github.com/lining0806/PythonSpiderNotes / ticket_worker_proxy

Function ticket_worker_proxy

QunarSpider/QunarSpider.py:81–100  ·  view source on GitHub ↗
(city_proxy)

Source from the content-addressed store, hash-verified

79 return proxy_list
80
81def ticket_worker_proxy(city_proxy):
82 city = city_proxy.split(',')[0]
83 proxy = city_proxy.split(',')[1]
84 proxy = Proxy({
85 'proxyType': ProxyType.MANUAL,
86 'httpProxy': proxy,
87 'ftpProxy': proxy,
88 'sslProxy': proxy,
89 'noProxy': '' # 过滤不需要代理的地址
90 })
91 driver = webdriver.Firefox(proxy=proxy)
92 driver.get(site)
93 driver.maximize_window() # 将浏览器最大化显示
94 for i in xrange(num):
95 if city == hot_city_list[i]:
96 continue
97 from_city = city
98 to_city = hot_city_list[i]
99 one_driver_ticket(driver, from_city, to_city)
100 driver.close()
101
102def all_ticket_proxy():
103 hot_city_proxy_list = []

Callers

nothing calls this directly

Calls 1

one_driver_ticketFunction · 0.85

Tested by

no test coverage detected