Clicking on a Javascript Link on Firefox with Selenium

前端 未结 1 803
梦毁少年i
梦毁少年i 2021-01-25 17:48

I am trying to get some comments off the car blog, Jalopnik. It doesn\'t come with the web page initially, instead the comments get retrieved with some Javascript. You only ge

相关标签:
1条回答
  • 2021-01-25 18:34

    Using Firefox with the Firebug plugin, I browsed to http://jalopnik.com/5912009/prius-driver-beat-up-after-taking-out-two-bikers.

    I then opened the Firebug console and clicked on ALL; it obligingly showed a single AJAX call to http://jalopnik.com/index.php?op=threadlist&post_id=5912009&mode=all&page=0&repliesmode=hide&nouser=true&selected_thread=null

    Opening that url in a new window gets me the comment feed you are seeking.

    More generally, if you substitute the appropriate article-ID into that url, you should be able to automate the process without Selenium.

    0 讨论(0)
提交回复
热议问题