一小伙使用 python爬虫来算命?

Python73

1.获取内容

我们今天呢,就先做一个通过星座来得知三天的运势的小玩意,

这里有十二个星座。我点击了第一个和第二个进入,即白羊座和金牛座:

[En]

There are twelve constellations here. I clicked the first and the second to enter, that is, Aries and Taurus:

就会发现一个规律
一小伙使用 python爬虫来算命?

一小伙使用 python爬虫来算命?

通过观察网址的链接,我这张丑脸泛起了灿烂的笑容。

也就是说,https://www.horoscope.com/us/horoscopes/general/是每个星座都共有的一段网址,

horoscope-general-daily-today.aspx?sign=1

我们只需改变today和sign={}对应的值就可以获取到每个星座对应的网址了

```

输入验证码查看隐藏内容

扫描二维码关注本站微信公众号 Johngo学长
或者在微信里搜索 Johngo学长
回复 svip 获取验证码
wechat Johngo学长