用selenium和webdriver爬网页得到的html是unicode的格式

lukeyyanghang 2017-02-28 04:02:17
我得到了完整的html,我该如何爬取想要的数据
...全文
443 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Haisen's 2019-03-10
  • 打赏
  • 举报
回复
你没理解楼主意思,是这个扒取的网页设置的是 UTF-8 但是里面的内容是 乱码文字,坚定为Unicode字符,浏览器测试是他。但是源文件打开还是乱码文字 ,这个怎么结解决,我在想怎样修改文件编码格式为 Unicode
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title itemprop="name">
破壁兔 - 一花一丼Œä¸€å¶ä¸€æ‰§è‘— </title>
<meta name="description" content="一个免流爱好者的博客"/>
<meta name="keywords" content="破壁兔,点对点免流,免流混淆"/>
<link rel="shortcut icon" href="./wp-content/themes/H-Siren-master/images/favicon.ico"/>
<link rel="stylesheet" href="wp-content/themes/H-Siren-master/OwO/meme.css" tppabs="./wp-content/themes/H-Siren-master/OwO/meme.css"/>
secsilm 2017-03-01
  • 打赏
  • 举报
回复
这个你得问题描述的很模糊,你可以给出个html例子和你想要的数据。 但是总体上就是根据 tag 和 CSS 来定位和抽取你要的数据。可以使用 BeautifulSoup 包。

37,719

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧