python爬虫 爬取steam热销游戏
好久没更新了啊。。。最近超忙 这学期学了学python 感觉很有趣 就写着玩~~~
爬取的页面是:https://store.steampowered.com/search/?filter=globaltopsellers&page=1&os=win
steam全球热销游戏榜单 一共599页
代码如下(很简单,函数都懒得写了,肯定看得懂):
import requests
from bs4 import BeautifulSoup #根据steam网页的命名规则
i =1 while i<599:
url = "https://store.steampowered.com/search/?filter=globaltopsellers&page=" + str(i) + "&os=win"
s = requests.session()
res = s.get(url).text
soup = BeautifulSoup(res, "html.parser")
contents = soup.find(id="search_result_container").find_all('a') for content in contents:
try:
name = content.find(class_="title").string.strip()
date = content.find("div",class_="col search_released responsive_secondrow").string.strip()
price= content.find("div",class_="col search_price responsive_secondrow").string.strip()
img_src = content.find("div",class_="col search_capsule").find('img').get("src")
href=content.get("href")
print(name,href,date,price,img_src)
except:
print("error")
i = i + 1
python爬虫 爬取steam热销游戏的更多相关文章
- Python爬虫 - 爬取百度html代码前200行
Python爬虫 - 爬取百度html代码前200行 - 改进版, 增加了对字符串的.strip()处理 源代码如下: # 改进版, 增加了 .strip()方法的使用 # coding=utf-8 ...
- 用Python爬虫爬取广州大学教务系统的成绩(内网访问)
用Python爬虫爬取广州大学教务系统的成绩(内网访问) 在进行爬取前,首先要了解: 1.什么是CSS选择器? 每一条css样式定义由两部分组成,形式如下: [code] 选择器{样式} [/code ...
- 使用Python爬虫爬取网络美女图片
代码地址如下:http://www.demodashi.com/demo/13500.html 准备工作 安装python3.6 略 安装requests库(用于请求静态页面) pip install ...
- Python爬虫|爬取喜马拉雅音频
"GOOD Python爬虫|爬取喜马拉雅音频 喜马拉雅是知名的专业的音频分享平台,用户规模突破4.8亿,汇集了有声小说,有声读物,儿童睡前故事,相声小品等数亿条音频,成为国内发展最快.规模 ...
- python爬虫爬取内容中,-xa0,-u3000的含义
python爬虫爬取内容中,-xa0,-u3000的含义 - CSDN博客 https://blog.csdn.net/aiwuzhi12/article/details/54866310
- Python爬虫爬取全书网小说,程序源码+程序详细分析
Python爬虫爬取全书网小说教程 第一步:打开谷歌浏览器,搜索全书网,然后再点击你想下载的小说,进入图一页面后点击F12选择Network,如果没有内容按F5刷新一下 点击Network之后出现如下 ...
- python爬虫—爬取英文名以及正则表达式的介绍
python爬虫—爬取英文名以及正则表达式的介绍 爬取英文名: 一. 爬虫模块详细设计 (1)整体思路 对于本次爬取英文名数据的爬虫实现,我的思路是先将A-Z所有英文名的连接爬取出来,保存在一个cs ...
- 一个简单的python爬虫,爬取知乎
一个简单的python爬虫,爬取知乎 主要实现 爬取一个收藏夹 里 所有问题答案下的 图片 文字信息暂未收录,可自行实现,比图片更简单 具体代码里有详细注释,请自行阅读 项目源码: # -*- cod ...
- python爬虫-爬取百度图片
python爬虫-爬取百度图片(转) #!/usr/bin/python# coding=utf-8# 作者 :Y0010026# 创建时间 :2018/12/16 16:16# 文件 :spider ...
随机推荐
- Python tqdm show progress bar
tqdm can help to show a smart progress bar, and it is very easy to use, just wrap any iterable with ...
- 好记性不如烂笔头-nginx安装环境与Linux安装ftp组件
Nginx安装环境 1. Nginx安装环境 Nginx是C语言开发,建议在linux上运行,我参加工作这些年来一直使用Linux发行版之一的 Centos作为安装环境. 1.1 gcc 安装Ngin ...
- Azure 11 月新公布
Azure 11 月新发布:Apple FairPlay Streaming, 应用服务(App Service), 虚拟机规模集(VMSS) Azure 媒体服务的 Apple FairPlay S ...
- ubuntu安装google test
google test 简称gtest,是一个C/C++的单元测试框架,它的代码在github仓库,使用起来还是挺方便的. 安装 先确保PC上有安装cmake: sudo cmake --versio ...
- May 16th 2017 Week 20th Tuesday
The most fearful enemy is not having a firm conviction. 最可怕的敌人,就是没有坚强的信念. A firm conviction or belie ...
- 【LOJ6052】「雅礼集训 2017 Day11」DIV(杜教筛)
点此看题面 大致题意: 求\(1\sim n\)内所有满足\(a>0\)的约数\(a+bi\)的\(a\)之和. 解题思路 首先,我们设\(x=(a+bi)(c+di)(1\le x\le n) ...
- Codeforces Round #431 (Div. 2)
A. Odds and Ends Where do odds begin, and where do they end? Where does hope emerge, and will they e ...
- LA 4987 背包
题意: 有n个施工队,给定他们的位置,有m个防空洞,给定位置,求将施工队放到m个防空洞里面,最少的总距离? n<=4000 分析: dp[i][j] 前 i 个施工队,放到前 j 个防空洞里面的 ...
- 0.Python 爬虫之Scrapy入门实践指南(Scrapy基础知识)
目录 0.0.Scrapy基础 0.1.Scrapy 框架图 0.2.Scrapy主要包括了以下组件: 0.3.Scrapy简单示例如下: 0.4.Scrapy运行流程如下: 0.5.还有什么? 0. ...
- Android学习笔记_28_手势识别
一.准备手势库: 使用SDK自带例子GestureBuilder建立手势库(位置:android-sdk-windows\samples\android-10\GestureBuilder).使用Ge ...