N
N
nikit0zzz2016-06-07 01:15:18
linux
nikit0zzz, 2016-06-07 01:15:18

Download site page, requires JS?

Tell me in which direction to move, you need to download the page, but when downloading with wget, it gives the following thing:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; " />
<script>
    document.cookie='_ddn_intercept_2_=183a18e779c8a3f5fce99745e69c59e7; max-age=604800; path=/';
    var nc = function() {return document.cookie.indexOf('_ddn_intercept_2_=183a18e779c8a3f5fce99745e69c59e7')==-1;};
    var w = function() {document.body.innerHTML = document.getElementsByTagName('noscript')[0].textContent;};
    if (!window.opera) {
        if (!nc()) {window.location.reload(true);}
        var r = function() {if (nc()) w();};
    } else {
        var r = function () {
            if (!nc()) {window.location.reload(true);}
            else {w();}
        }
    }
</script>
</head>
<body onload="r()">
<noscript>You have to turn on javascript and cookies support in browser to visit this site.<br/>
Для посещения этого сайта необходима поддержка javacript и cookies Вашим браузером<br/>
<a href="http://ddos-guard.net">ddos-guard.net</a>
</noscript>
</body>
</html>

How can this be bypassed in wget or python script?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
Zelimkhan Beltoev, 2016-06-07
@Beltoev

You can emulate a browser using Selenium:

from selenium import webdriver
browser = webdriver.Firefox()
browser.get(raw_input("адрес страницы"))
html_text = browser.page_source # нужный текст

#
#algooptimize #bottize, 2016-06-07
@user004

document.cookie='_ddn_intercept_2_=183a18e779c8a3f5fce99745e69c59e7; max-age=604800; path=/';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question