简体   繁体   English

使用 Python 的 Selenium 无法完全打开网站

[英]Selenium with Python not able to fully open the website

I have tried the following code and tried to open the website as mentioned:我尝试了以下代码并尝试打开上述网站:

driver = webdriver.Chrome(r"..\chromedriver_win32\chromedriver.exe")
driver.get("https://trade.mql5.com/trade")

The website opens with the Chrome Browser but not with the Selenium using Python.该网站使用 Chrome 浏览器打开,但不使用使用 Python 的 Selenium 打开。

Please let me know what should I do to open the website completely.请让我知道我该怎么做才能完全打开网站。

You can run it with chrome options.您可以使用 chrome 选项运行它。 I am able to launch your application with below code:我可以使用以下代码启动您的应用程序:

from time import sleep
from selenium import webdriver

PATH = "chromedriver path"
option = webdriver.ChromeOptions()
option.add_argument('--disable-blink-features=AutomationControlled')
option.add_argument("start-maximized")
option.add_experimental_option(
    "excludeSwitches", ["enable-automation"])
option.add_experimental_option('useAutomationExtension', False)

driver = webdriver.Chrome(PATH, options=option)


url = 'https://trade.mql5.com/trade'

driver.get(url)
driver.maximize_window()
sleep(20)

output:输出:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM