现在服务使用硒(动态网络刮擦)的网络刮擦

发布于 2025-01-31 05:38:18 字数 1089 浏览 3 评论 0原文

是否有人有任何解决方法可以在硒中选择动态内容?

我有一个不会被选中的特定标签。我尝试通过以下方式选择元素:class,link_text,xpath等。我尝试为每项动作放慢脚本。例如;输入用户名,等待10秒,选择登录,等待10秒,输入密码,等待10秒。等等。

该项目是可以手动单击的,但我当然是使用自动化。欢迎任何建议。我已经在破裂的时间附加了代码。希望我的问题有意义。 程序工作流程:

  1. 立即登录服务

  2. 打开有关未分配的备份日志的特定过滤队列

  3. 在队列中处理每个未分配的备份日志。

  4. 如果队列中没有日志,请等待15分钟,然后在刷新网络浏览器后重复步骤3。

    def Process_asigra_ticket(self):

  • 在未分配的队列中打开1个ASIGRA票,并作为服务台代理进行处理,是否会在日志中输出erorrs。
  • 请注意未分配的队列中处理的每个机票的INC,并将Loggin消息发送到团队频道。
  • MS Teams频道以后可用于审核脚本的运作方式。如果

       

driver = self.driver 

虽然是正确的:

 try:
    first_incident = WebDriverWait(driver, 7).until(EC.element_to_be_clickable((By.CLASS_NAME, "linked formlink"))) # code won't select this icon for the life of it 
    time.sleep()
    first_incident.click()

我正在收到以下错误消息:

提高timeoutexception(消息,屏幕,stacktrace) selenium.common.exceptions.TimeOutException:消息:

Does anyone have any workarounds for selecting dynamic content within Selenium?

I have a particular tag that just won't get selected. I have tried selecting the element by: class, link_text, xpath and more. I have tried slowing down the script for every action taken. For example; enter username, wait 10 seconds, select logon, wait 10 seconds, enter password, wait 10 seconds. etc.

The item is clickable manually, but of course my aim is to use automation. Any advice would be welcome. I have attached my code at the point where it breaks. Hope my question makes sense.
Program workflow:

  1. Log into service now

  2. Open a specific filtered queue of incidents concerning backup logs that are unassigned

  3. Process each unassigned backup log in the queue.

  4. If there are no logs in the queue, wait 15 minutes and repeat step 3 after refreshing the web browser.

    def process_asigra_ticket(self):

  • Opens 1 asigra ticket in the unassigned queue and processes it as a service desk agent would do whether erorrs are outputted in a log or not.
  • Takes note of the INC for each ticket processed in the unassigned queue and sends a loggin message to a teams channel.
  • MS teams channel can later be used for auditing how the script has functioned. If
driver = self.driver 

while True:

 try:
    first_incident = WebDriverWait(driver, 7).until(EC.element_to_be_clickable((By.CLASS_NAME, "linked formlink"))) # code won't select this icon for the life of it 
    time.sleep()
    first_incident.click()

I'm receiving the following error message:

raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文