I've been informed by everyone that I should be able to retrieve the table content using PhantomJS when working with JavaScript. However, despite my attempts, I have not been successful.
My expectation was to obtain the table from the website
Page 1 displays correctly.
But when I attempt to navigate to page 2 by clicking on the CSS selector location, it still returns the content from page 1. What could be causing this issue?
#coding:utf-8
from selenium import webdriver
import time
from selenium.webdriver.support.ui import WebDriverWait
driver = webdriver.PhantomJS()
driver.get("http://data.eastmoney.com/xg/xg/default.html")
time.sleep(2)
driver.find_element_by_css_selector("#PageCont > span.at").click()
list_cates = driver.find_element_by_css_selector("#dt_1 > tbody > tr:nth-child(1) > td:nth-child(2) > a").text
print(list_cates)