Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
selenium click a span tag
#2
Do not do any loop,before you have tested that it work on first span tag.

Code under will return the first match of span tag,
make sure that this is the right span tag(can be more in source).
browser.find_element_by_tag_name("span")
Can return a list so test with:
browser.find_element_by_tag_name("span")[0].click()
Try with a more excat mact(CSS selector/xPath) to "span" tag you want to test click on.
Edit:
And lower case in .Click(),so .click()
Reply


Messages In This Thread
selenium click a span tag - by metulburr - Nov-30-2016, 07:10 AM
RE: selenium click a span tag - by snippsat - Nov-30-2016, 05:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Click on a button on web page using Selenium Pavel_47 7 4,715 Jan-05-2023, 04:20 AM
Last Post: ellapurnellrt
  trying to scrape a span inside a div using beautifulsoup CompleteNewb 2 9,140 Jan-28-2021, 01:20 PM
Last Post: snippsat
  select all the span text with same attribute JennyYang 2 2,147 Jul-28-2020, 02:56 PM
Last Post: snippsat
  Log In Button Won't Click - Python Selenium Webdriver samlee916 2 3,839 Jun-07-2020, 04:42 PM
Last Post: samlee916
  Hyperlink Click is not working in Selenium webdriver rajeev1729 0 2,039 May-02-2020, 11:21 AM
Last Post: rajeev1729
  selenium click in iframe fails 3Pinter 6 5,146 Apr-29-2020, 12:59 PM
Last Post: Larz60+
  Scrap a dynamic span hefaz 0 2,705 Mar-07-2020, 02:56 PM
Last Post: hefaz
  Cannot get contents from ul.li.span.string LLLLLL 8 4,021 Nov-29-2019, 10:30 AM
Last Post: LLLLLL
  Python Selenium .click() Loads Error - Works Manually.- Events not Triggered NSearch 24 11,853 Aug-14-2019, 02:23 PM
Last Post: NSearch
  Selenium click on popup button??? GuJu 7 7,927 Jul-20-2019, 09:21 AM
Last Post: Nizam

Forum Jump:

User Panel Messages

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