win10升级到1607后,chrome突然全部乱码

本文介绍了解决Win10系统升级至1607版本后Chrome浏览器出现乱码的问题,提供了两种方法:一是通过添加-no-sandbox参数临时解决;二是通过禁用DirectWrite字体渲染系统彻底解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

win10升级到1607后,chrome突然全部乱码,设置页面也是乱码,网上查到

  • 右键单击Chrome在桌面的快捷方式,选择“属性”,在对话框的“目标”项目中追加 -no-sandbox参数

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -no-sandbox

重新打开后,显示-no-sandbox模式下,乱码没有了,到设置那里的高级设置,重置所有设置后,以正常方式无-no-sandbox打开后,进入百度的确没有乱码了,但是查看设置后,设置里面还是乱码,回到百度网页,也变成乱码了。

然后又看到有人通过如下方式关闭directwrite渲染,成功解除乱码模式。

第一步:在chrome浏览器中输入chrome://flags/

     并且回车

第二步:在打开的页面中找到停用DirectWrite,点击下面的“启用”,然后重启浏览器即可禁用DirectWrite字体渲染系统。

 

 

 

import requests from bs4 import BeautifulSoup import pandas as pd import matplotlib.pyplot as plt # 定义函数用于抓取单页数据 def fetch_page_data(page_url): headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " "(KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" } response = requests.get(page_url, headers=headers) response.encoding = 'utf-8' # 解决编码问题 soup = BeautifulSoup(response.text, 'html.parser') movies = [] for item in soup.find_all('div', class_='item'): title = item.find('span', class_='title').text.strip() rating = float(item.find('span', class_='rating_num').text.strip()) # 转换为浮点数方便后续处理 director_tag = item.select_one('.bd p:nth-of-type(1) a') director = director_tag.text.strip() if director_tag else '未知' movies.append({ '电影名称': title, '评分': rating, '导演': director }) return movies # 主程序开始 base_url = "https://movie.douban.com/top250?start={}&filter=" all_movies = [] for page in range(10): # 遍历第1到第10页 start_index = page * 25 # 每页有25部电影 url = base_url.format(start_index) page_data = fetch_page_data(url) all_movies.extend(page_data) # 数据可视化部分 ratings = df['评分'].values # 获取所有评分值 plt.hist(ratings, bins=10, color='blue', edgecolor='black') # 绘制直方图 plt.title("豆瓣Top250电影评分分布") # 设置标题 plt.xlabel("评分") # X轴标签 plt.ylabel("频次") # Y轴标签 plt.grid(axis='y', linestyle='--', alpha=0.7) # 添加网格线 plt.show() 为什么运行出来的标题无法显示
最新发布
04-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值