Python Forum
Multiple input box in a webpage have same XPATH
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple input box in a webpage have same XPATH
#1
I am crawling in a webpage which have two input box in two different tabs inside the page. But the problem is that class name, id name is same for both of the input box. While I am trying to access the input box in the second tab like- clicking in the box or send some keystrokes(by send_keys()) using selenium. I am not able to access that using this below script -
driver.find_elements_by_xpath('(//*[@id="d_value"])').click()
because an exception arises that -
Error:
driver.find_elements_by_xpath('(//*[@id="d_value"])'[1]).click() AttributeError: 'list' object has no attribute 'click'
yes I know that If there are some situations like this arise xpath only can locate the first element, and it happens due to the bug of that page. But I want to know is there any solution to handle this situation using selenium and continue to crawl in the page by neglecting the bug. I searched for the solution on google but nothing happens to be beneficial for me, if anyone knows, please share with me.
Reply


Messages In This Thread
Multiple input box in a webpage have same XPATH - by sumandas89 - Jul-18-2018, 01:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  need help with xpath pythonprogrammer 1 2,776 Jan-18-2020, 11:28 PM
Last Post: snippsat
  webpage input module rudolphyaber 2 2,213 Feb-26-2019, 12:13 AM
Last Post: Larz60+
  display multiple sensors on webpage python flask jinja pascale 6 5,330 Jan-29-2019, 10:10 AM
Last Post: pascale
  Scrape Multiple items from a webpage Prince_Bhatia 2 3,346 Sep-12-2017, 06:08 AM
Last Post: Prince_Bhatia

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020