私信  •  关注

ThunderMind

ThunderMind 最近创建的主题
ThunderMind 最近回复了
7 年前
回复了 ThunderMind 创建的主题 » 如何通过python请求登录iptorrents.com

我注意到你正在使用此链接登录网站

https://www.iptorrents.com/login.php

而不是让用户登录的api调用。 如果你仔细注意到这是一个网络呼叫,用户登录到网站。

https://www.iptorrents.com/take_login.php

有效载荷结构为:

payload = {
    'username': 'zzzz',
    'password': 'zzzzzzzzz',
}
7 年前
回复了 ThunderMind 创建的主题 » 如何在xpath命令中使用python scrapy进行web抓取

现在假设你有任何类似的,所以你可以试试这个。 x_path = '//*[@id="olnof_{}_altlinesodd"]/tr[1]/TD[1]/A[1]' x_path.format("put your any here, may b from rand function or extracting the value from somewhere else.") 然后, table = response.xpath(x_path) 这就行了。

7 年前
回复了 ThunderMind 创建的主题 » python scrapy项目返回url列表,并在url内部刮取内容
games = response.css("div.home-a").extract_first()

div.home-a 包含多个 divs ,您正在提取第一个 extract_first() 转换为 div 变成一根绳子。

我从链接中得到的是,你的css没有给你想要的。

试试这个

css = '[itemprop="url"]::attr(href)'
games = response.css(css).extract()    #list of game urls