用cheerio模拟button点击
任何人都可以指导我如何模拟与cheeriobutton点击?
该button是一个图像button。 点击后如何处理__dopostback
?
谢谢
编辑:我正在尝试下面的代码
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0'; // Ignore 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' authorization error var request = require('request'); var cheerio = require('cheerio'); function postback(url, callback) { request.get(url, function onResponse(err, res, body) { $ = cheerio.load(body); var button = callback(err, $); if (button) { var form = { __EVENTTARGET: button.attr('Button1'), __VIEWSTATE: $('#__VIEWSTATE').val(), __EVENTVALIDATION: $('#__EVENTVALIDATION').val(), __EVENTARGUMENT: $('__EVENTARGUMENT').val(), user:'username', pass: 'pasword', }; request.post(url, {form: form }, onResponse); } }); } postback('https://mysite.com', function(err, $) { var button=$('input[type="image"]'); return button })
- Web在Cheerio中抓取HTML表格
- 将节点请求响应响应上传到MongoDB
- 如何获得cheerio.js中的节点行号?
- 如何写HTML结构的cheerio查询?
- 获取TypeError:当使用cheerio和jsonframe进行刮取时,selector.includes不是一个函数
- 为了使我的代码工作,我不得不改变cheerio的一些核心function,我怎么能坚持它在我的模块?
- 节点js cheerioparsinghtml
- 尝试使用Node.jsdynamic路由从IMDB中取消电影内容。 但得到undefined在我的output.json文件?
- 使用Node.js,请求和cheerio从网站上刮下链接?