This may be a two part question so forgive me if this isn't well written:
I'm trying to get my WebDriver to go to the nba team stats page: http://stats.nba.com/teams/traditional/#!?sort=W_PCT&dir=-1
and then click the linked FGM numbers in the table. This should open a new tab in the background. So far I'm completely lost how I should be approaching this.
I'm thinking:
I'm sure I can get the data with BeautifulSoup but I'm trying to practice with Selenium and working with tables/links that can vary in length. Any leads are appreciated. Thanks!
Python example:
from selenium import webdriver
from selenium.webdriver import ActionChains
web_driver = webdriver.Firefox()
web_driver.get("http://stats.nba.com/teams/traditional/#!?sort=W_PCT&dir=-1")
actions = ActionChains(driver)
team_links = webdriver.find_elements_by_xpath("//body//td[contains(@class, 'first')]/a")
for link in team_links:
actions.key_down(Keys.CONTROL).click(link).key_up(Keys.CONTROL).perform()