Welcome Guest Search | Active Topics | Sign In | Register

Can't get full html content! Options
Yen.Dang
Posted: Wednesday, September 8, 2021 1:10:24 AM
Rank: Member
Groups: Member

Joined: 9/8/2021
Posts: 10
Hi ,
please check help me get full html from this site:
it is responsive website type.
I used webview+thread to get it like in your tutorial (webview document).
However the returned html is incomplete.
so i was not able to parse the node.


How can I fix this?



Regards,
Yen.Dang
Yen.Dang
Posted: Wednesday, September 8, 2021 12:14:11 PM
Rank: Member
Groups: Member

Joined: 9/8/2021
Posts: 10
Hi admin,
My shortcoming. I need to click on the expand button before taking it.
I will look into using java environment and come back later.
Yen.Dang
Posted: Wednesday, September 8, 2021 1:19:34 PM
Rank: Member
Groups: Member

Joined: 9/8/2021
Posts: 10
Hi admin,
The problem has been resolved. I have the following alternative questions:
If I use Power BI, the htmls are fully loaded one at a time.

In my case, if I don't use the click function feature, I won't get all the rows.
Question 1: Is there any interactive way to get a one-time content without click button?
Question 2: If I use button.InvokeFunction("click") function, I'm not sure if I need to wait for it to load or not? (currently it is working for me)
How should I safely handle it?

Hope you understand what I mean!

Thanks you!
eo_support
Posted: Wednesday, September 8, 2021 1:59:33 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

This has to do with how your page works. If your page only loads entries when the button is clicked, then obviously you have to click the button. If your page uses a JavaScript function to load the rows and call that JavaScript function when the button is clicked, then obviously calling the same function without actually clicking the button could work. The key here is --- how you get the rows completely depends on how this is implemented in your page. The WebView can not change how your page works.

As to your second question, calling "click" method would trigger all event handler code related to the click. If the handler code loads all rows immediately, then by the time you are done calling "click" method, those rows are loaded. If your handler code loads the rows asynchronous (for example, by initiating an AJAX call back to the server, and then populate the rows when it receives response from the server), then there is no guarantee that the rows will be populated by the time you are done calling the "click" method. Once again, this completely depends on how loading the rows are implemented just like your first question.

Hope this clears up.

Thanks!
Yen.Dang
Posted: Wednesday, September 8, 2021 2:36:46 PM
Rank: Member
Groups: Member

Joined: 9/8/2021
Posts: 10
Hi admin,
For question 2:
If I need loads rows asynchronously, how should I handle it?
I mean something safe like this:

webView.LoadAndWait(button.InvokeFunction("click")).

Where should I start?
eo_support
Posted: Wednesday, September 8, 2021 2:57:46 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Yen.Dang wrote:
Hi admin,
For question 2:
If I need loads rows asynchronously, how should I handle it?
I mean something safe like this:

webView.LoadAndWait(button.InvokeFunction("click")).

Where should I start?


You can not rely on us on this kind of questions. Your question has nothing to do with us or our product. It has to do with the code in your page, so we have no way of answering your question at all. This is like you make a phone call to your friend and asks him to do something for you and then you want the phone to tell you when it will be done. The phone would not know when the task will be done in this case. Only your friend can tell you when it will be done. In this example we are the phone and your friend is the code in your page.
Yen.Dang
Posted: Wednesday, September 8, 2021 3:31:14 PM
Rank: Member
Groups: Member

Joined: 9/8/2021
Posts: 10
Hi,
I mean do you guys provide such a built-in function or not?
I think it's not the problem.
So why do you have this function? webView.LoadUrlAndWait("http://www.google.com")
which is not : webView.navigate("http://www.google.com")
I suppose you could provide an event that checks the page has finished loading and that the user can use it for later task.
eo_support
Posted: Wednesday, September 8, 2021 4:52:47 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
A page completes loading and a page completes running are two different things. For example, you can have a page that displays a clock and the page can complete loading in a second. However the page will never complete running because the clock will tick forever.

To give you another example that might be closer to your scenario, you can have a page that keeps growing ---- it adds a new line to the bottom of the page that says "The time now is xxxx" using JavaScript. And this can go on forever. You have no way to tell when the page has "finished" adding all rows because it never finishes.

What LoadUrlAndWait does is wait for the page to complete loading. What you are asking is when the page has completed running. There is no single unified way to know whether a page has completed running (just like the two examples above can run forever and never finishes). So you are looking for something that does not exist. You have to find it on your end (from the page) if your page does have a clear definition of when it has finished its work.
Yen.Dang
Posted: Wednesday, September 8, 2021 8:52:28 PM
Rank: Member
Groups: Member

Joined: 9/8/2021
Posts: 10
Hi admin,
Thank you.
I will guard against it.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.