Selenium Python: clicking links produced by JSON application -
[ ed: maybe i'm asking this? not sure -- capture json response through selenium ]
i'm trying use selenium (python) navigate via hyperlinks pages in web database. 1 page returns table hyperlinks want selenium follow. links not appear in page's source. html corresponds table of interest tag indicating site pulling results facet search. within div <script type="application/json"> tag , handful of search options. nothing else.
again, can view hyperlinks in firefox, not using "view page source" or selenium's selenium.webdriver.firefox().page_source call. instead, call outputs not <script> tag series of <div> tags appear define results' format.
is selenium unable navigate output json applications? or there way capture output of such applications? thanks, , apologies lack of code/reproducibility.
try using execute_script() , links running javascript, like:
driver.execute_script("document.queryselector('div#your-link-to-follow').click();") note: if div generated scripts dynamically, may want implicitly wait few seconds before executing script.
Comments
Post a Comment