(city_proxy)
| 79 | return proxy_list |
| 80 | |
| 81 | def 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 | |
| 102 | def all_ticket_proxy(): |
| 103 | hot_city_proxy_list = [] |
nothing calls this directly
no test coverage detected