如何跟踪从各个 301 到我的目标页面的路线?

发布于 2024-10-04 22:10:29 字数 565 浏览 2 评论 0原文

对于可能知道的人来说,这个简单的问题对我来说是世界上最困难的事情:

有这个网址:http://hstgb.tradedoubler.com/file/118779/banners/searchboxes/holidays_search_8Sep09 .html?url=http://clkgb.tradedoubler.com/click?p=118779&a=1868402&g=18436588

这是一个附属网址(我并不是想让你买任何东西;) )

现在,当我单击“搜索”时,它会将我带到一个中间页面,然后该页面将参数发送到最后一分钟以打开目标页面。

第二页的速度太快了,我无法查看它或无论如何阅读它的源代码。如何跟踪发送的页面和参数?

Simple question for someone who might know, the most difficult thing in the world for me:

There's this url: http://hstgb.tradedoubler.com/file/118779/banners/searchboxes/holidays_search_8Sep09.html?url=http://clkgb.tradedoubler.com/click?p=118779&a=1868402&g=18436588

It's an affiliate url (I'm not trying to get you to buy anything ;) )

Now when I click search, it takes me to an intermediary page, which then sends parameters to lastminute to open the destination page.

The second page goes so quickly that I cannot view it or anyhow read it's source code. How do I track the page and parameters sent?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

墟烟 2024-10-11 22:10:29

您可以使用数据包嗅探器(例如Wireshark)或监视网络流量的浏览器插件来捕获每个请求发送的内容和收到的每个页面。

You could use a packet sniffer such as Wireshark or a browser add-on that monitors network traffic, to capture every request that gets send and every page that gets received.

盗琴音 2024-10-11 22:10:29

好吧,我写了一个小 python 来找出答案。

import urllib

def make_request(url, method='GET'):
    protocol, hostpath = urllib.splittype(url)
    if hostpath[:2] != '//':
        hostpath = '//' + hostpath
    host, path = urllib.splithost(hostpath)
    if len(path.strip()) == 0 or path[0] != '/':
        path = '/' + path
    query = "%s %s HTTP/1.1\r\nHost: %s\r\n\r\n"%(method, path, host)
    if protocol != 'http' and protocol is not None:
        raise ValueError, 'Invalid protocol specified.  http only'

    addresses = socket.getaddrinfo(host, 80)
    return (addresses, query)


def do_request(addresses, query):
    sock_type = addresses[0][:3]
    addr = addresses[0][4]
    connection = socket.socket(*sock_type)
    connection.connect(addr)
    connection.sendall(query)
    return connection

def urlpeek(url):
    return do_request(*make_request(url))

当我查看您提供的地址时,看起来服务器实际上返回了 200 OK 响应,该响应主要由 javascript 组成...

Well, I wrote a little python to find out.

import urllib

def make_request(url, method='GET'):
    protocol, hostpath = urllib.splittype(url)
    if hostpath[:2] != '//':
        hostpath = '//' + hostpath
    host, path = urllib.splithost(hostpath)
    if len(path.strip()) == 0 or path[0] != '/':
        path = '/' + path
    query = "%s %s HTTP/1.1\r\nHost: %s\r\n\r\n"%(method, path, host)
    if protocol != 'http' and protocol is not None:
        raise ValueError, 'Invalid protocol specified.  http only'

    addresses = socket.getaddrinfo(host, 80)
    return (addresses, query)


def do_request(addresses, query):
    sock_type = addresses[0][:3]
    addr = addresses[0][4]
    connection = socket.socket(*sock_type)
    connection.connect(addr)
    connection.sendall(query)
    return connection

def urlpeek(url):
    return do_request(*make_request(url))

When I perform a peek on the address you give, it looks like the server is actually returning a 200 OK response, which consists mainly of javascript...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文