单击后,我想获取页面的页面源。然后使用browser.back()函数返回。但是Selenium不允许单击后完全加载页面,并且由JavaScript生成的内容未包含在该页面的页面源中。
element[i].click()
#Need to wait here until the content is fully generated by JS.
#And then grab the page source.
scoreCardHTML = browser.page_source
browser.back()
Run Code Online (Sandbox Code Playgroud)