Skip to content

getPage returns the same old page #327

@niemand23oa

Description

@niemand23oa

Hi there,

I have a middleware platform which has jobs scheduled to scrap data from a website by calling the same Java service which uses HtmlUnit (by passing different search parameters to the web page). Therefore, it might happen that multiple separate threads are used with HtmlUnit.
The problem is that method getPage returns the same old page no matter what I set in the code. I tried to use below configs:

client.getCache().clear();
client.getCache().setMaxSize(0);
client.getOptions().setCssEnabled(true);
client.getOptions().setJavaScriptEnabled(true);

No matter what I do, below code always returns the same page:

page = client.getPage(webPageURL);

I also tried the method refresh() but it just won't work.
Can you please tell me what I am missing?

Best regards,
n23

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions