随笔分类 - python、crawler
数据采集,数据挖掘,数据分析
摘要:1、iframe的切入和切出 #切入 driver.switch_to.frame(driver.find_element_by_id('iFrame_1')) # 切换出来 driver.switch_to.default_content() 2、句柄的切入和切出 main_windows = d
阅读全文
摘要:八戒你瘦了!测试python selenium。 # coding:utf-8 import time import os from selenium import webdriver from selenium.webdriver.common.action_chains import Actio
阅读全文
摘要:配置使用环境 下载相应的浏览器驱动, Firefox 是默认的 本文以 chrome 为主 ,放在scripts目录下ChromeDriver 官方下载地址 : 所有版本的 ChromeDriver 文档参考 简明 Python 教程 Python教程 - 廖雪峰 官方文档 : Selenium w
阅读全文
摘要:1、直接上代码 # coding:utf-8 import time import os from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains path = os
阅读全文
摘要:# coding:utf-8 import requests import hashlib import time import json def interpret(contents): url = 'http://fanyi.youdao.com/translate_o?smartresult=
阅读全文
摘要:# coding:utf-8 import json import pandas as pd with open("./article_file/all_article.json","r",encoding="gbk") as f: text = json.load(f) article_dict
阅读全文
摘要:# coding:utf-8 import requests import json from bs4 import BeautifulSoup # 搜索页面 def get_home_page(page): html = "https://s.weibo.com/article?q=%E5%8F%
阅读全文
摘要:# 爬起摄图网的图片批量下载# coding:utf-8 import requests from bs4 import BeautifulSoup from scipy.misc import imresize import numpy as np import os # 我们下载摄图网的10个种类图片 climbImage = requests.get( # url = 'http...
阅读全文