This forum is in archive mode. You will not be able to post new content.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Fam5AHcno5

Pages: [1]
1
Java / How to mimic a web browser using Jsoup?
« on: July 30, 2015, 09:15:32 PM »
First of all, I checked this link:
http://stackoverflow.com/questions/7797386/how-to-mimic-a-web-browser-from-java-using-jsoup
But I don't think this question has a complete answer. I'm writing a bot for an online game, and I want to mimic Firefox exactly. Right now the methods that I'm utilizing are:

Code: [Select]

        browsedCon = Jsoup.connect(myURL)
                .userAgent(firefoxUserAgent)
                .referrer(myCurrentURL)
                .cookies(myCookies)
                .followRedirects(true)
                .timeout(1000)
                .method(Connection.Method.GET)
                .execute();

myCookies are the cookies from he previous page. I'm fairly certain that this is not how Firefox works, so I definitely need some improvement there. I think I might be missing the cookies from the redirected page.
Also, I'm downloading images referred in the html document, at the beginning of my browsing session. What else should I consider to make my code completely unnoticeable?
 

Pages: [1]


Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.