tags:

views:

169

answers:

1

Following this question I get a message on the retrieved page that "Your browser does not support JavaScript so some functionality may be missing!"

If I open this page with web(url) in MATLAB web browser and accept certificate (once per session), the page opens properly.

How can I save the page source from the browser with a script? Or from system browser? Or may be there is a way to get that page even without browser?

url='https://cgwb.nci.nih.gov/cgi-bin/hgTracks?position=chr7:55054218-55242525';
+2  A: 

From what I could tell the page source gets downloaded just fine, just make sure to let Javascript run when you open the saved page locally.

[...]
<script type='text/javascript' src='../js/hgTracks.js'></script>
<noscript><b>Your browser does not support JavaScript so some functionality may be missing!</b></noscript>
[...]

Note that the solution you are using only downloads the web page without any of the attached stuff (images, .css, .js, etc..).

What you can do is call wget to get the page with all of its files:

url = 'https://cgwb.nci.nih.gov/cgi-bin/hgTracks?position=chr7:55054218-55242525';
command = ['wget --no-check-certificate --page-requisites ' url];
system( command );

If you are on a Windows machine, you can always get wget from the GnuWin32 project or from one of the many other implementations.

Amro
The problem is I need to select some additional tracks. Then those settings are saved. Browser's cache or cookies, or session (some session id is passed), not sure. I can set it up with a browser. But how I can do it with page after wget?
yuk
Im not sure I understand the question.. Are you trying to pass POST-data and use cookies/session-cookies? If thats the case check the manual: http://www.gnu.org/software/wget/manual/html_node/HTTP-Options.html
Amro