javascript - 如何使用nodejs/python抓取whatsapp网页?

标签 javascript python node.js web-scraping whatsapp

连接到手机后,Whatsapp 网页会显示完整的聊天记录和联系人。 但是在console.log(html)里面,html内容仍然就像我没有连接到手机一样。

nodeJs 端有什么需要做的身份验证吗?

var request = require('request');
var cheerio = require('cheerio');

request('https://web.whatsapp.com/', function (error, response, html) 
{
  if (!error && response.statusCode == 200) {
    console.log(html);
   }
});

最佳答案

您可以在 Python 中使用 selenium 轻松实现您想要做的事情。一旦你用手机在由 selenium 打开的浏览器上扫描二维码,你就可以开始使用 selenium 捕获按钮和其他内容并自动打字和点击。

我制作了一个聊天机器人,可以在 Whatsapp 中通过 X 射线诊断肺部疾病,您可以在这里引用我的代码:https://github.com/skaravind/Whatsapp-Radiologist

希望对你有帮助!

关于javascript - 如何使用nodejs/python抓取whatsapp网页?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46844342/

相关文章:

javascript - 如何使用 Angular 2 在 POST 上启用 ASP.NET MVC 4 中的跨源请求

python - 用结构重建我的波形文件

python - 如果字段值在外部列表中,Django 注释 bool 值

javascript - JQuery 插件 : Function using $(this) inside the plugin's options

javascript - 如何在自定义元素中提供后备 CSS 值?

javascript - 如何在 [JavaScript] 中实现分页

python - (Python,数据帧): Record the average of all numbers in a column that are smaller than the n'th percentile

node.js - 如何在不使用 fs.exists 的情况下检查文件或目录是否存在?

node.js - 如何在嵌入式文档数组上使用 $geoNear?

node.js - 类型错误 : Cannot read property 'findOne' of undefined