有关Chrome的about:blank情况解决办法及出现原因

问题:chrome打开一个链接时,总显示about:blank#blocked。

解决方法:检查Chrome的插件列表,暂时关闭AD block plus或与之功能类似的插件。

========================================================================

问题:“about:blank页面有什么用?

回答:许多网络浏览器使用 URL 来访问网页。 “About”是与浏览器通信以显示内部网页的“about:URL”命令的一部分。因此,我们所遇到的空白页面实际上是您的网络浏览器中的一个内置命令。“about”部分处理浏览器的多个内部命令。事实上,Web 浏览器使用几个“about:”命令来重新加载已内置在浏览器中的页面。例如,尝试在地址栏中输入“about:settings”,您将被重定向到浏览器的设置页面。其他一些常见的“关于”页面是“about:downloads”、“about:about”、“about:plugins”和“about:extensions”。

=========================================================================

出现情况:单击了在新选项卡或窗口中打开的下载链接,此过程可能会强制浏览器在启动下载时显示空白页面。

=========================================================================

出现情况:在浏览器的地址栏中输入了错误的 URL,浏览器会将您重定向到感染了恶意软件或病毒的错误页面。 

=========================================================================

出现情况:加载页面的时候网络失去连接或出现网站崩溃,可以暂时进行等待,防止多次刷新造成服务器拥堵,从而加剧崩溃修复难度。

=========================================================================

出现情况:  网页或浏览器本身的 HTML、Java 和其他代码中的错误或错误。

 =========================================================================

最后,about:blank 页面对您的计算机无害。您不是恶意软件攻击的受害者。它只是一个空白屏幕,当您的互联网浏览器没有足够的信息可以采取行动时,它会在网站上弹出。  

  • 8
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By options = webdriver.ChromeOptions() options.add_argument('--ignore-certificate-errors') options.add_experimental_option('excludeSwitches', ['enable-automation']) options.add_argument("--disable-blink-features=AutomationControlled") options.add_argument('--disable-gpu') # 谷歌文档提到需要加上这个属性来规避bug options.add_argument('blink-settings=imagesEnabled=false') # 不加载图片, 提升速度 # options.add_argument('--headless') # 浏览器不提供可视化页面. linux下如果系统不支持可视化不加这条会启动失败 options.binary_location = './chrome-win/chrome.exe' driver_path = Service("chromedriver.exe") driver = webdriver.Chrome(service=driver_path, options=options) # 打开网站 print('正在登录!') driver.get('http://www.weather.com.cn/jiangsu/index.shtml') elements = driver.find_elements(By.XPATH, '''//*[@id="forecastID"]/dl/dd/a/b'''),from PySide2.QtWidgets import QApplication,QMainWindow from ui_main import Ui_MainWindow from PySide2.QtCore import QUrl class MainWindow(QMainWindow): def init(self): super().init() # 使用ui文件导入定义界面类 self.ui = Ui_MainWindow() # 初始化界面 self.ui.setupUi(self) # 使用界面定义的控件,也是从ui里面访问 self.ui.webview.load(QUrl('about:blank')) # 获取页面对象 page = self.ui.webview.page() # 设置页面缩放比例 page.setZoomFactor(1) self.ui.webview.load(QUrl('http://www.python3.vip/')) app = QApplication([]) mainw = MainWindow() mainw.show() app.exec_(),请合并这两段代码
最新发布
06-08
你可以将这两段代码合并成一个,如下所示: ``` from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By from PySide2.QtWidgets import QApplication, QMainWindow from ui_main import Ui_MainWindow from PySide2.QtCore import QUrl class MainWindow(QMainWindow): def __init__(self): super().__init__() # 使用ui文件导入定义界面类 self.ui = Ui_MainWindow() # 初始化界面 self.ui.setupUi(self) # 使用界面定义的控件,也是从ui里面访问 self.ui.webview.load(QUrl('about:blank')) # 获取页面对象 page = self.ui.webview.page() # 设置页面缩放比例 page.setZoomFactor(1) # 使用Selenium库控制Chrome浏览器 options = webdriver.ChromeOptions() options.add_argument('--ignore-certificate-errors') options.add_experimental_option('excludeSwitches', ['enable-automation']) options.add_argument("--disable-blink-features=AutomationControlled") options.add_argument('--disable-gpu') # 谷歌文档提到需要加上这个属性来规避bug options.add_argument('blink-settings=imagesEnabled=false') # 不加载图片, 提升速度 # options.add_argument('--headless') # 浏览器不提供可视化页面. linux下如果系统不支持可视化不加这条会启动失败 options.binary_location = './chrome-win/chrome.exe' driver_path = Service("chromedriver.exe") driver = webdriver.Chrome(service=driver_path, options=options) # 打开网站 print('正在登录!') driver.get('http://www.weather.com.cn/jiangsu/index.shtml') elements = driver.find_elements(By.XPATH, '''//*[@id="forecastID"]/dl/dd/a/b''') if __name__ == '__main__': app = QApplication([]) mainw = MainWindow() mainw.show() app.exec_() ``` 注意:这段代码可能需要根据你的具体环境进行调整,比如Chrome浏览器的安装路径和版本,以及Chromedriver的文件名和路径等。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值