逆向工程:arrow.com 上每页的结果
我试图增加每页的结果,例如当您打开时: http://components.arrow.com/part/search/BAV99
该网站为您提供通过单击链接 50 来选择显示 10、25、50 或 100 的选项。现在我的问题是如何使用curl 显示 99999 个结果。
I am trying to increase the results per page for example when you open:
http://components.arrow.com/part/search/BAV99
The website gives you the option to choose from displaying 10, 25, 50 or 100 by clicking on the link 50. Now My question is how I would display 99999 results with curl for example.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我使用 Fiddler2 提出以下 HTTP 请求,看起来它在一页上返回所有 143 个匹配项。我通过观察从下拉列表中选择“100 个结果”时发送的 HTTP 请求来完成此操作。然后,我复制原始请求,将其粘贴到 Fiddler2 的 RequestBuilder 中,更改
limit=200
并执行它。我将 WebView 中的响应与网站上显示的实际页面进行了比较。I used Fiddler2 to come up with the following HTTP request, which looks like it returns all 143 matching items one a single page. I did this by watching the HTTP request that was sent when I selected "100 Results" from the drop-down. I then copied the raw request, pasted it into Fiddler2's RequestBuilder, changed the
limit=200
, and executed it. I compared the response in the WebView against the actual pages displayed on the website.您要定位的页面,http://components.arrow.com/part/search/BAV99 ,使用表单提供 POST 数据,服务器使用该数据来识别要返回的记录数、用于分页的起始偏移量、应如何排序等。
正如 @EvanLarsen 在 他的答案,你需要使用curl -d“”。
然而,看起来该网站将正确响应仅提供您真正关心的那些字段的请求。
仅返回第一条记录:
仅返回第二条记录:
返回 99999 条记录(如您所问):
如果您想要一个像样的 UI 以便在 Web 浏览器中更轻松地修改和提交 POST 数据以及查看结果(而不是使用 <代码>curl),查看 Request Maker Chrome 扩展程序。
The page you're targeting, http://components.arrow.com/part/search/BAV99, uses a form to supply POST data the server uses to identify how many records to return, what starting offset to use for pagination, how it should be sorted, etc.
As @EvanLarsen's noted in his answer, you need to use
curl -d "<POST_DATA>" <URL>
.However, it appears the site will properly respond to a request with only those fields you actually care about supplied.
To return only the first record:
To return only the second record:
To return 99999 records (as you asked):
If you want a decent UI to make modifying and submitting POST data and viewing results easier in a web browser (instead of using
curl
), check out the Request Maker Chrome Extension.试试这个:
Try this:
这是通过使用 Chrome 开发人员工具(或 Firebug)来完成的:
但正如其他人提到的,服务器正在限制这个参数,所以你不能发送
9999
This is accomplished by using Chrome Developer tools (or Firebug):
But as others mentioned, the server is restricting this parameter, so you cannot send
9999