Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Grab external web page, interrogate HTML from project Javascript - Possible?

I have an app that needs to grab an external HTML Web page, interrogate the HTML and report on items within the HTML.

Is this possible in Tiggzi? I dont want the page displayed, just accessible to my project javascript.
If so, can you let me know how to do this please?

regards

Andy

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Grab external web page, interrogate HTML from project Javascript - Possible?

Hi Andy,

We support only Rest Services with Content Type = XML or JSON. You can't get content of another page using JavaScript due to browser security restrictions (http://en.wikipedia.org/wiki/Same_ori...). To use data from other sites on Appery page you should create Rest Service that will interrogate web pages and send XML or JSON data to Appery.

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Grab external web page, interrogate HTML from project Javascript - Possible?

ok, understood, thanks for that.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Grab external web page, interrogate HTML from project Javascript - Possible?

There is a workaround.

You would need to create Rest Service with URL points to Web page. After adding Rest service on Complete event add Run JavaScript action. Page HTML content will be stored in this Action in string variable jqXHR.responseText. You will be able to get data from the HTML code using JavaScript.

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Grab external web page, interrogate HTML from project Javascript - Possible?

Hi Katya,

I'm really struggling to get this working.

I've added a REST service, and set the URL to the page I want to capture.
Method is GET, Data Type is XML (not sure if thats right).
I don't know what to add as the response code/data?

Can you expand more on the workaround you mentioned please?

Return to “Issues”