-3

I want to extract some data from an HTML page.

I tried it with php, but I got an issue because this page is only available if you are connected to a specific network: unfortunately, my client is connected to that network, but not my server, so php requests fail.

My question is: if I try to scrape the page with javascript instead of php, will my request seem to come from my client network?

user1071138
  • 656
  • 3
  • 12
  • 30
  • `scrape the page with javascript` Not possible unless the remote page allows remote connections. If it does, then the request will be from your clients. – Dave Chen Jul 29 '13 at 08:21
  • @DaveChen why is it not possible with javascript? – DevZer0 Jul 29 '13 at 08:27
  • Please read https://developer.mozilla.org/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript – Dave Chen Jul 29 '13 at 08:29
  • @DaveChen you also check out https://github.com/tautologistics/node-htmlparser/ – DevZer0 Jul 29 '13 at 08:49
  • it's easy with javascript, as long as you can see the info on the page, javascript can send that info somewhere else, like a file. Tampermonkey is the best scraping platform around these days. all you need to do is create a new userscript for the site/page, and in that script grab the innerHTML(s) and download it to a file or push it to another url waiting to capture the data into something like a DB. – dandavis Jul 29 '13 at 20:32

1 Answers1

0

No it won't, unless you execute it in a browser which is already on your clients network! What you should checkout perhaps is a proxy or a VPN. Route your servers traffic through your clients network, this way it will appear to be coming from there IP address.

jdog
  • 174
  • 6
  • Yes, the page with javascript source will be located on my server, but it's executed in a browser which is already on my clients network. Will it appear to be coming from which ip addr? – user1071138 Jul 29 '13 at 08:49