主要是给我的投币器做个铺垫,果然软件还是太容易了,难在硬件和外壳好吗!
1 把edge的调试端口打开:
添加以下参数:
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --remote-debugging-port=9225 --user-data-dir="C:\Users\10913\AppData\Local\Microsoft\Edge\User Data\Default"
2 装EDGE的驱动,这个轻车熟路不说了,目前我用的SELEIUM3 据说4变化比较大 先不用
3 py脚本在此
from msedge.selenium_tools import Edge, EdgeOptions # pip install msedge-selenium-tools
from selenium.webdriver.common.by import By
import time
edge_options = EdgeOptions()
edge_options.use_chromium = True
edge_options.add_argument("disable-gpu")
edge_options.add_experimental_option("debuggerAddress", "127.0.0.1:9225")
driver = Edge(options=edge_options)
nowpage=driver.current_url
if 'https://www.bilibili.com/video' in nowpage:
print('在看BILIBILI视频')
buttons = driver.find_element(by=By.CLASS_NAME,value="coin")
#print(buttons)
buttons.click()
time.sleep(0.5)
try:
sure = driver.find_element(

文章讲述了如何使用Edge浏览器的调试端口和Selenium库来实现自动化点击B站视频的投币功能。首先开启Edge的远程调试端口,然后配置EdgeOptions,通过Python脚本控制浏览器行为,找到并点击投币按钮。作者提到这种方法也可用于爬虫验证,提高效率。

6818

被折叠的 条评论
为什么被折叠?



