Reputation: 1705
I'm on a webpage with the following code:
from selenium import webdriver
from bs4 import BeautifulSoup
driver = webdriver.Chrome('C:/.../chromedriver_win32/chromedriver')
link = 'http://performance.morningstar.com/funds/etf/total-returns.action?t=IWF'
driver.get(link)
How do I click on this tab called "Monthly":
EDIT:
The HTML that corresponds to this section is:
In this case, what "element" should I select to click on?
Upvotes: 0
Views: 2616
Reputation: 3471
You can do in this way:
elem1= driver1.find_element_by_xpath("//ul[@class='in_tabs']")
elem1.find_element_by_xpath(".//a[@tabname='#tabmonth']").click()
As you can imagine, with the first you select the element in_tabs and with the second the interested element.
Upvotes: 2