How to browse a whole website using selenium?

前端 未结 5 813
悲哀的现实
悲哀的现实 2020-12-03 15:39

Is it possible to go through all the URIs of a given URL (website) using selenium ?

My aim is to launch firefox browser using selenium with a given URL of my choice

5条回答
  •  不思量自难忘°
    2020-12-03 16:25

    As Khyati mentions it is possible, however, selenium not a webcrawler or robot. You have to know where/what you are trying to test.

    If you really want to go down that path I would recommend that you hit the page, pull all elements back and then loop through to click any elements that would correspond to navigation functionality (i.e. "//a" or hyperlink click).

    Although if you go down this path and there is a page that opens another page then has a link back you would want to keep a list of all visited URL's and make sure that you don't duplicate a page like that.

    This would work, but would also require a bit of logic in it to make it happen...and you might find yourself in an endless loop if you aren't careful.

提交回复
热议问题