擅长:python、mysql、java
<p>所以这是我写的附加代码,现在我可以很好地保存动态生成的内容,并使用BeautifulGroup获得我想要的标记:</p>
<pre><code>from contextlib import closing
from selenium.webdriver import Firefox
from selenium.webdriver.support.ui import WebDriverWait
with closing(Firefox()) as browser:
browser.get('https://finance.yahoo.com/quote/IONS?p=IONS')
button = browser.find_element_by_link_text('Statistics')
button.click()
#WebDriverWait(browser, timeout=10).until(
#lambda x: x.find_element_by_class_name('Fz(s) Fw(500) Ta(end)'))
page_source = browser.page_source
print(page_source)
yahoo_finance = BeautifulSoup(page_source, 'html.parser')
</code></pre>
<p>@neftes@Padraic Cunningham谢谢你的提示。在</p>