Chromeではありませんが ‥‥
Python
1from selenium import webdriver
2import sys
3
4def proxy_Phantom(driver,ip,port):
5
6 driver.command_executor._commands['executePhantomScript'] = ('POST', '/session/$sessionId/phantom/execute')
7
8 val = "phantom.setProxy(" + chr(34) + ip + chr(34) + "," + chr(34) + port + chr(34) + ");"
9 dic = {}
10 dic["script"] = val
11 dic["args"] = []
12 driver.execute('executePhantomScript', dic)
13
14 return driver
15
16
17driver = webdriver.PhantomJS( executable_path="c:\drivers\phantomjs.exe")
18
19PROXY_IP = "AAA.BBB.CCC.DDD"
20PROXY_PORT = "xxxx"
21driver = proxy_Phantom(driver,PROXY_IP ,PROXY_PORT)
22driver.get('https://www.ugtop.com/spill.shtml')
23print (driver.find_element_by_css_selector('body > div:nth-child(2) > table:nth-child(3) > tbody > tr:nth-child(3) > td > font').text)
24
25
26PROXY_IP2 = "EEE.FFF.GGG.HHH"
27PROXY_PORT2 = "yyyy"
28driver = proxy_Phantom(driver,PROXY_IP2 ,PROXY_PORT2)
29driver.get("https://www.ugtop.com/spill.shtml")
30print (driver.find_element_by_css_selector('body > div:nth-child(2) > table:nth-child(3) > tbody > tr:nth-child(3) > td > font').text)
31
32driver.quit()
33sys.exit(0)
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/06/08 07:41