【发布时间】:2025-12-17 12:10:02
【问题描述】:
我正在使用 python 和 selenium。在this 链接上,我会点击Reply 添加评论
元素在点 (933.9500122070312, 16.666671752929688)。其他元素会收到点击:
<a href="/create_account"></a>
此处给出的代码:
导入请求 从 bs4 导入 BeautifulSoup from gensim.summarization 导入总结
从硒导入网络驱动程序
from datetime import datetime
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys
from time import sleep
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
driver.get(url)
sleep(4)
f = driver.find_element_by_css_selector('.PostFull__reply')
f.location_once_scrolled_into_view
f.click()
更新
这是它在 Inspector 中的显示方式:
【问题讨论】:
-
您要查找哪个元素? PostFull__reply 不在页面上
-
@YuZhang 问题已更新为图片
-
您登录帐户了吗?
-
是的。顺便说一句,如果你没有登录,链接就会出现