|
@@ -38,12 +38,19 @@ def re_get_webdriver():
|
|
|
user_agent = ua.random()
|
|
|
|
|
|
options = webdriver.ChromeOptions()
|
|
|
+
|
|
|
+
|
|
|
+ mobile_emulation = {
|
|
|
+ "deviceMetrics": { "width": 360, "height": 640, "pixelRatio": 3.0 },
|
|
|
+ "userAgent": "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19" }
|
|
|
+ options.add_experimental_option("mobileEmulation", mobile_emulation)
|
|
|
+
|
|
|
options.add_argument("--no-sandbox")
|
|
|
options.add_argument("--disable-dev-shm-usage")
|
|
|
options.add_argument("--headless")
|
|
|
|
|
|
- print(user_agent)
|
|
|
- options.add_argument("--user-agent=" +user_agent)
|
|
|
+# print(user_agent)
|
|
|
+# options.add_argument("--user-agent=" +user_agent)
|
|
|
options.add_argument("--incognito")
|
|
|
driver=None
|
|
|
try:
|