Python:BeautifulSoup缺少标签

时间:2015-07-16 12:29:21

标签: python beautifulsoup

我编写了一个python程序,列出了page上存在的所有子编辑。我正在使用BeautifulSoup(BS)。它工作正常。问题是BS缺少页面中的所有nsfw潜艇。

我的节目输出

http://www.reddit.com/subreddits
http://www.reddit.com/r/funny/
http://www.reddit.com/r/pics/
http://www.reddit.com/r/AdviceAnimals/
http://www.reddit.com/r/todayilearned/
http://www.reddit.com/r/gifs/
http://www.reddit.com/r/BlackPeopleTwitter/
http://www.reddit.com/r/videos/
http://www.reddit.com/r/WTF/
http://www.reddit.com/r/aww/
http://www.reddit.com/r/AskReddit/
http://www.reddit.com/r/gaming/
http://www.reddit.com/r/leagueoflegends/
http://www.reddit.com/r/worldnews/
http://www.reddit.com/r/me_irl/
http://www.reddit.com/r/news/
http://www.reddit.com/r/pcmasterrace/
http://www.reddit.com/r/politics/
http://www.reddit.com/r/4chan/
http://www.reddit.com/r/trees/
http://www.reddit.com/r/TrollXChromosomes/
http://www.reddit.com/r/space/
http://www.reddit.com/r/Showerthoughts/
http://www.reddit.com/r/mildlyinteresting/
http://www.reddit.com/r/GlobalOffensive/
http://www.reddit.com/r/movies/

与实际的子reddit列表完全同步。所以我想知道它为什么缺少nsfw subs。当我看到页面的源代码时,与其他sfw subs没什么不同。感谢。

如果需要任何其他信息,请询问。

由于

编辑:事实证明,当我提出reddit请求时,它没有任何cookie。默认情况下,reddit.com会显示SFW子reddits。要在python中模拟浏览器体验,您必须使用浏览器的cookie。

0 个答案:

没有答案