Please turn JavaScript on and reload the page_12

There is no”error”. You make a GET request using curl. It yields you a few HTML. The HTML occurs to include mainly links to JavaScript code your browser is supposed to load also to implement. Your browser (using JS activated) could load the. Js scripts and operate them. Those scripts would generate some neat web page. If you do not load the scripts that are connected, nor execute themthen you certainly don’t get much from the page. Consider employing a correct headless browser instead (see illustration below). Here is a small example that is supposed to demonstrate the stage: Source code empty, page complete!

Virtually nothing there in the source code! … but inspect this div after JS is executed.

Just save this as"some thing. Html", and start it from the browser. When you ask you browser to Please turn JavaScript on and reload the page show page source, then this is precisely what you could get. However, when you inspect the div by right-clicking on it, it will show a that it has >1000 child components attached to it. Those are created by JS in your browser, and they don't come in the server in form of HTML. Edit I attempted to get the page using PhantomJS, it almost worked. Here's what I did: ! /bin/bash cat < /tmp/phantomjsScript. Js var page require('page'). Create(); webpage. Open(' com', function(status) if(status ==="victory") console. log(page. FrameContent); ghost. Exit();); HereDoc phantomjs / / tmp/phantomjsScript. Js This is a bash script which creates a helper script /tmp, which is later implemented by phantomjs. PhantomJS loads the website, and executes the JavaScript. Regrettably, the website which you have linked to is shielded by a captcha-mechanism, and isn't directly available, so the above example employs example. Id instead. If you can somehow operate round the captcha, you probably can use a similar script to automatically load the HTML, run the JS, and then dump the rendered DOM into the console.

Để lại bình luận

Scroll
0973225722