【发布时间】:2020-04-09 22:29:55
【问题描述】:
我使用库 python selenium 。 我想点击聊天中出现的最后一条消息。
这是网站:https://i.bc.game/i-x40k2jw-n/
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
options = webdriver.ChromeOptions()
options.add_argument("javascript.enabled")
options.add_argument("--user-data-dir=chrome-data")
#options.add_argument("--incognito")
options.add_argument("start-maximized")
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")
driver = webdriver.Chrome(executable_path='chromedriver.exe', chrome_options=options)
driver.get("https://i.bc.game/i-x40k2jw-n/")
time.sleep(10)
while True:
try:
python_button = driver.find_element_by_css_selector(".coindrop-status")
python_button.click()
except:
print("wait...")
【问题讨论】:
标签: python python-2.7 selenium