【发布时间】:2022-01-28 00:56:01
【问题描述】:
我正在运行一个 selenium 文件,并且一直收到此错误,我知道错误在哪一行,但我认为它存在的唯一原因是因为它一直在该行上循环,直到按钮可单击为止。但是其余的我不知道是什么意思。关于这意味着什么的任何想法?
[9708:37344:1229/082641.495:ERROR:chrome_browser_main_extra_parts_metrics.cc(226)] crbug.com/1216328: Checking Bluetooth availability started. Please
[9708:37344:1229/082641.495:ERROR:chrome_browser_main_extra_parts_metrics.cc(229)] crbug.com/1216328: Checking Bluetooth availability ended.
[9708:37344:1229/082641.496:ERROR:chrome_browser_main_extra_parts_metrics.cc(232)] crbug.com/1216328: Checking default browser status started. Please
[9708:7028:1229/082641.499:ERROR:device_event_log_impl.cc(214)] [08:26:41.499] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node
[9708:37344:1229/082641.533:ERROR:chrome_browser_main_extra_parts_metrics.cc(236)] crbug.com/1216328: Checking default browser status ended.
[4132:5052:1229/092045.310:ERROR:ssl_client_socket_impl.cc(983)] handshake failed; returned -1, SSL error code 1, net_error -101
[4132:5052:1229/092045.311:ERROR:ssl_client_socket_impl.cc(983)] handshake failed; returned -1, SSL error code 1, net_error -101
Traceback (most recent call last):
File "C:\Users\rhino\BotArmy\gpubuyer2.py", line 3, in <module>
buyer("URL")
File "C:\Users\rhino\BotArmy\Functions.py", line 85, in buyer
CheckBuyButton()
发生的代码:特别是在 addToCartBtn 行
while not check:
if(wd.find_element(By.CLASS_NAME,"add-to-cart-button").is_enabled()):
addToCartBtn = wd.find_element(By.CLASS_NAME, "add-to-cart-button")
check = True
else:
wd.refresh()
元素的html
<button class="c-button c-button-primary c-button-lg c-button-block c-button-icon c-button-icon-leading add-to-cart-button" type="button" data-sku-id="6419203" data-button-state="ADD_TO_CART" style="padding:0 8px"><svg aria-hidden="true" role="img" viewBox="0 0 100 100" style="width:16px;height:16px;margin-right:9px;fill:currentColor"> Add to Cart</button>
【问题讨论】:
-
你能用你的代码试验更新问题吗?
-
抱歉,代码试验是什么意思?
-
我的意思是你使用的代码。
-
能否将代码作为文本粘贴到问题中?
标签: python selenium xpath css-selectors webdriverwait