資源簡介
京東定時自動秒殺工具
python,掃描京東二維碼登錄,設置時間,定時自動搶購
代碼片段和文件信息
#?JDAutoBuy
import?os
import?sys
from?selenium?import?webdriver
import?datetime
import?time
import?json
from?os?import?path
?
#將下面的路徑替換為你電腦內chromedriver所在的路徑
driver?=?webdriver.Chrome(“C:\\Program?Files?(x86)\\Google\\Chrome\\Application\\chromedriver“)
#headless_opt?=?webdriver.ChromeOptions()
#headless_opt.add_argument(‘--headless‘)
#time_driver?=?webdriver.Chrome(“C:\\Program?Files?(x86)\\Google\\Chrome\\Application\\chromedriver“?chrome_options=headless_opt)
#time_driver.get(“https://a.jd.com//ajax/queryServerData.html“)
#json_text?=?time_driver.find_element_by_css_selector(‘body‘).get_attribute(‘innerText‘)
#timest?=?json.loads(json_text)[‘serverTime‘]????????
#now?=?timest
def?login():
????driver.get(“https://www.jd.com/“)
????if?driver.find_element_by_class_na
評論
共有 條評論