Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Retrieve figure from a Javascript web



Permlink Replies: 8 - Last Post: Jun 9, 2017 3:46 AM Last Post By: Shun Yi Tsai Threads: [ Previous | Next ]
Shun Yi Tsai

Posts: 9
Registered: 8/22/10
Retrieve figure from a Javascript web
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 6, 2017 7:49 AM
Hello,

I would like to retrieve figure from a Javascript web. TNetHTTPClient doesn't seem to meet my requirement. On the web, some figure are come out after clicking button.
1. How should I do it on C++ Builder?
2. What VCL should I utilize?

Ben
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Retrieve figure from a Javascript web
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 7, 2017 9:37 AM   in response to: Shun Yi Tsai in response to: Shun Yi Tsai
Shun Yi Tsai wrote:

I would like to retrieve figure from a Javascript web. TNetHTTPClient
doesn't seem to meet my requirement. On the web, some figure are come
out after clicking button. 1. How should I do it on C++ Builder? 2.
What VCL should I utilize?

What kind of figure exactly are you referring to?

Javascript is a client-side technology. It doesn't matter what HTTP
library you use to download the script, you still need to actually
execute the script in order to get any result from it. And setting up
a simulated environment that mimics a web browser for a web-based
script to run in is very involved. If you are trying to extract
dynamically-generated content, you woulud have to use an actual web
browser control, let it download and execute the script, and then you
can extract content from the browser's DOM interfaces after they have
been manipulated by the script.

--
Remy Lebeau (TeamB)
Shun Yi Tsai

Posts: 9
Registered: 8/22/10
Re: Retrieve figure from a Javascript web
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 7, 2017 7:48 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Shun Yi Tsai wrote:

I would like to retrieve figure from a Javascript web. TNetHTTPClient
doesn't seem to meet my requirement. On the web, some figure are come
out after clicking button. 1. How should I do it on C++ Builder? 2.
What VCL should I utilize?

What kind of figure exactly are you referring to?

Javascript is a client-side technology. It doesn't matter what HTTP
library you use to download the script, you still need to actually
execute the script in order to get any result from it. And setting up
a simulated environment that mimics a web browser for a web-based
script to run in is very involved. If you are trying to extract
dynamically-generated content, you woulud have to use an actual web
browser control, let it download and execute the script, and then you
can extract content from the browser's DOM interfaces after they have
been manipulated by the script.

--
Remy Lebeau (TeamB)

Thank you for reply.
1. I would like to retrieve some stock quotes or share price from financial web site. Some figures are dynamically-generated.
2. If using actual web browser, what RTL should I use? I found C++ Builder 10.2 doesn't offer TWEBBrowser.
3. Beside actual web browser, is there other way to quickly retrieve the content?

Ben
Asger Joergensen

Posts: 370
Registered: 11/18/08
Re: Retrieve figure from a Javascript web
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 8, 2017 5:13 AM   in response to: Shun Yi Tsai in response to: Shun Yi Tsai
Hi Shun

Shun Yi Tsai wrote:

Thank you for reply.
1. I would like to retrieve some stock quotes or share price from financial
web site. Some figures are dynamically-generated.
2. If using actual web browser, what RTL should I use? I found C++ Builder
10.2 doesn't offer TWEBBrowser.
3. Beside actual web browser, is there other way to quickly retrieve the
content?

You might need to install the right package to get TCppWebBrowser and TWebBrowser
have a look at this thread:

https://forums.embarcadero.com/thread.jspa?messageID=885609&tstart=0#885609

Best regards
Asger
Shun Yi Tsai

Posts: 9
Registered: 8/22/10
Re: Retrieve figure from a Javascript web
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 8, 2017 7:52 AM   in response to: Asger Joergensen in response to: Asger Joergensen
Asger Joergensen wrote:
Hi Shun

Shun Yi Tsai wrote:

Thank you for reply.
1. I would like to retrieve some stock quotes or share price from financial
web site. Some figures are dynamically-generated.
2. If using actual web browser, what RTL should I use? I found C++ Builder
10.2 doesn't offer TWEBBrowser.
3. Beside actual web browser, is there other way to quickly retrieve the
content?

You might need to install the right package to get TCppWebBrowser and TWebBrowser
have a look at this thread:

https://forums.embarcadero.com/thread.jspa?messageID=885609&tstart=0#885609

Best regards
Asger

Hi Asger,

Thank you for reply.
Where could I find the package (bcbie250.bpl) to get TCppWebBrowser and TWebBrowser ?

Ben
Asger Joergensen

Posts: 370
Registered: 11/18/08
Re: Retrieve figure from a Javascript web
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 8, 2017 10:35 AM   in response to: Shun Yi Tsai in response to: Shun Yi Tsai
Hi Shun

Shun Yi Tsai wrote:

Hi Asger,

Thank you for reply.
Where could I find the package (bcbie250.bpl) to get TCppWebBrowser and TWebBrowser ?

Mine is in Embarcadero\Studio\Redist\win32

you should install locate32, then you will never spent time looking for files again.

http://www.locate32.net/

Best regards
Asger
Shun Yi Tsai

Posts: 9
Registered: 8/22/10
Re: Retrieve figure from a Javascript web
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 9, 2017 3:42 AM   in response to: Asger Joergensen in response to: Asger Joergensen
Asger Joergensen wrote:
Hi Shun

Shun Yi Tsai wrote:

Hi Asger,

Thank you for reply.
Where could I find the package (bcbie250.bpl) to get TCppWebBrowser and TWebBrowser ?

Mine is in Embarcadero\Studio\Redist\win32

you should install locate32, then you will never spent time looking for files again.

http://www.locate32.net/

Best regards
Asger

Hi Asger,

Thank you for reply.

I did find bcbie.bpl in my computer.

Ben
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Retrieve figure from a Javascript web
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 8, 2017 11:39 AM   in response to: Shun Yi Tsai in response to: Shun Yi Tsai
Shun Yi Tsai wrote:

1. I would like to retrieve some stock quotes or share price from
financial web site. Some figures are dynamically-generated.

Does the website in question not provide a SOAP or REST API for
accessing the data? You really should not be parsing HTML pages when
you can avoid it.

I found C++Builder 10.2 doesn't offer TWEBBrowser.

Yes, it does.

3. Beside actual web browser, is there other way to quickly retrieve
the content?

Don't rely on HTML if possible. Rely on SOAP/REST instead.

--
Remy Lebeau (TeamB)
Shun Yi Tsai

Posts: 9
Registered: 8/22/10
Re: Retrieve figure from a Javascript web
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 9, 2017 3:46 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Shun Yi Tsai wrote:

1. I would like to retrieve some stock quotes or share price from
financial web site. Some figures are dynamically-generated.

Does the website in question not provide a SOAP or REST API for
accessing the data? You really should not be parsing HTML pages when
you can avoid it.

I found C++Builder 10.2 doesn't offer TWEBBrowser.

Yes, it does.

3. Beside actual web browser, is there other way to quickly retrieve
the content?

Don't rely on HTML if possible. Rely on SOAP/REST instead.

--
Remy Lebeau (TeamB)

Hi Remy,

Thank you for reply.

The website doesn't seem RESTful or REST-compliant.
http://mis.twse.com.tw/stock/group.jsp?ind=24&ex=tse&currPage=0&type=all

Ben
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02