Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to test every link on a WEBSITE. I googled a lot but there were only solutions to test every link on a WEBPAGE.

How I wanted to do it: If the script clicks on a link, the script looks on the new webpage if there is a new link. If there is a new link then the script clicks it and repeats the steps(look and click) untill he cannot find a link. In that case the script navigates back until he finds a new link to click.

Does anyone have a solution for me? I am using Java.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
272 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can use a recursive function to open a link, findElements by Html tag name , and call the function again for each of these links in the list. Be aware that, this can go on for a while, you might run out of memory etc because all web pages normally have links.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...