Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6712753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:17:48+00:00 2026-05-26T08:17:48+00:00

I am using a query like this in jSoup: Document doc = Jsoup.connect(urlString).timeout(1000).post(); It

  • 0

I am using a query like this in jSoup:

Document doc = Jsoup.connect(urlString).timeout(1000).post();

It works for some sites, however:

  • it doesn’t work for Google search queries (e.g. urlString = “http://www.google.com/search?q=text”) – I don’t know why, how it is special

  • result documents contain messages like “JavaScript should be turned on in your browser” which I would rather avoid

  • there are probably more quirks, but I haven’t tested it fully yet…

My question: could these problems be avoided if we could mimic a web browser more closely? What is the best way to do it?

What are the other differences that can be encountered between getting pages via web browser and via Java (URLConnection or jSoup)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:17:49+00:00Added an answer on May 26, 2026 at 8:17 am

    I realized that the problem with some sites not responding was actually that I was using post() instead of get(). With get() it works fine now!

    It also probably helps to add userAgent to the query, for example:

    .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
    

    In the meantime, I’ve also tested HtmlUnit for the same task, and it worked, but it seems like an overkill for the purpose to simply get an HTML file (for some kind of processing). It basically runs a whole invisible web browser in the background to do this task.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using SQL Server 2005. The query would look like this Select col1, col2,
I would like to turn this query to regular inline sql without using stored
I am using linq with SQL CE, but for a simple query like this:
How do I execute a query like this using PHP: SELECT [name] FROM [items]
I need to insert a data into a DB using query like this one:
I'm using a simple mysql LIKE query like this: SELECT * FROM myTable WHERE
I am currently searching my database with a query (using JDBC) like this: ...
We are using grails-groovy with Hibernate, I have a SQL query like this in
I am attempting to SELECT rows from a table using a query like this
I'm using Postgres and I'm trying to write a query like this: select count(*)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.