摘要:
#!/usr/bin/env python # coding: utf-8 # In[3]: from bs4 import BeautifulSoup # # BeautifulSoup介绍 # 1、BeautifulSoup是基础HTML DOM的,会载入整个文档构建整个DOM树,因此时间和内存开销大,性能也就更低,而lxml只是进行局部的遍历 # # 2、BeautifulSou... 阅读全文
摘要:
import requests import json def translation(): #发送翻译内容的网址 url = "http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule&smartresult=ugc&sessionFrom=null" #翻译时需要发送的数据,目前只可以中英... 阅读全文
摘要:
'''利用selenium爬取网页内容''' import re import time from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webd 阅读全文
摘要:
'''利用selenium爬取淘宝美食网页内容''' import re from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.co 阅读全文
摘要:
下面是城市的数据: domestic_list = [ {'北京': ['beijing', '8221']}, {'上海': ['shanghai', '6996']}, {'广州': ['guangzhou', '2727']}, {'成都': ['chengdu', '5369']}, {'深 阅读全文
摘要:
import requests import json import time position = input('输入你要查询的职位:') url = 'https://www.lagou.com/jobs/positionAjax.json?city=%E6%9D%AD%E5%B7%9E&needAddtionalResult=false' headers = { 'User-A... 阅读全文
摘要:
1、通过爬取历史首页,来获取城市地址和历史时间,构建链接; ''' 获取全国的城市名称和链接 ''' import requests from lxml import etree import random import pymongo from time_list import get_time 阅读全文
摘要:
1、获取网站课程的分类地址; ''' 爬取屌丝首页,获取每个分类名称和链接 ''' import requests from lxml import etree headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWe 阅读全文