有没有一种有效的方法来找出传递到站点的标头、cookie 和获取/发布数据?
更具体地说,我正在寻找一些东西,也许是 firefox 的附加组件,一旦启用,它就会在传入和传出服务器时记录所有这些信息。我正在做一些网络脚本,这真的很方便。
如果有人想知道我目前在做什么,我正在尝试制作一个脚本,每隔 2 天重新发布我的 craigslist 广告,因为我在那里处理了一些事情。甚至可能制作一个简单的 GUI 来管理提交。
我确实怀疑这违反了服务条款,因此我不打算发布代码。除了 cl 对于垃圾邮件来说已经够糟糕的了,我并不想对此做出进一步的贡献,我想我会为了诚实而说出我正在做的事情。我对此没有任何恶意,只是我一直试图出售的一些东西以及我的电脑维修业务的广告。几个月来我一直在重新发布一些东西,但我经常忘记这样做。
More specifically I'm looking for something, perhaps an add-on for firefox, once enabled it logs all of this information as it's passed to and from the server. I'm doing some web scripting and this would be really handy.
If anyone is wondering specifically what I'm doing currently I'm trying to make a script to repost my craigslist ad every 2 days since I handle a few things on there. Might even go so far as to make a simple gui to manage the submissions.
I do suspect this goes against the ToS, for that reason I don't plan to release the code. Besides cl is already bad enough with spam, I'm not trying to contribute further to it, figured I'd say what I'm doing for the sake of being honest though. I don't have any bad intentions with this, just some things I've been trying to sell and an ad for my pc repair business. I've been reposting some things for months now and so often I just forget to do it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Firefox Web 开发者工具栏的网络模块可让您查看请求和响应中的 HTTP 标头,因此这是一个很好的起点。不过,它不会为您记录所有内容,因此如果您想稍后检查,则必须将所有内容复制到文本编辑器。
由于您还使用 Python 标记了您的帖子,因此我推测您正计划在 Python 中实现您的脚本。看一下
mechanize
模块,它为您提供了一个简单的虚拟浏览器Python 中“记住”cookie 和其他东西的对象。The Network module of the Firefox Web Developer Toolbar lets you look at the HTTP headers in the request and the response, so it's a good starting point. It won't log everything for you, though, so you will have to copy everything to a text editor if you want to inspect it later.
Since you also tagged your post with Python, I presume you are planning to implement your script in Python. Take a look at the
mechanize
module which gives you a simple virtual browser object in Python that "remembers" cookies and stuff.我使用了 Firefox 扩展 LiveHTTPHeaders 并且效果很好为我。
I've used the Firefox extension LiveHTTPHeaders and it has worked well for me.
Wireshark 非常适合记录和读取传入和传出计算机的数据包。
Wireshark is great for logging and reading packets passed to and from your computer.
我发现 Firebug 网络面板对此非常有用。
I find the Firebug net panel really useful for this.