From e069cb37886e4f3af863848344e36318bce189a5 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sun, 16 Jul 2017 12:57:11 +0200 Subject: [PATCH] Fake user agent. Just for fun and giggles. --- readit.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/readit.py b/readit.py index aeb58db..aa1ca6f 100755 --- a/readit.py +++ b/readit.py @@ -79,7 +79,10 @@ if __name__ == "__main__": ids = parser.parse_args().id - driver = webdriver.PhantomJS(service_args=["--web-security=no"]) + caps = webdriver.DesiredCapabilities().PHANTOMJS.copy() + caps["phantoms.page.settings.userAgent"] = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0" + + driver = webdriver.PhantomJS(desired_capabilities=caps, service_args=["--web-security=no"]) for id in ids: use = id.split("/")[-1].split("#")[0]