抓取https://sf.taobao.com/item_list.htm信息

    

    

    driver=webdriver.PhantomJS(service_args=['--ssl-protocol=any'])
    or
    driver = webdriver.PhantomJS( service_args=['--ignore-ssl-errors=true'])
    cur_driver=webdriver.PhantomJS(service_args=['--ssl-protocol=any', '--load-images=false']) 
    
    service_args=['--load-images=false']
 

  抓取代码

# coding=utf-8
import os
import re
from selenium import webdriver
# from selenium.common.exceptions import TimeoutException
import selenium.webdriver.support.ui as ui
import time
from datetime import datetime
from selenium.webdriver.common.action_chains import ActionChains
import IniFile
# from threading import Thread
from pyquery import PyQuery as pq
import LogFile
import mongoDB
import urllib class taobao(object):
def __init__(self):
      
self.driver = webdriver.PhantomJS(service_args=['--ssl-protocol=any'])
self.driver.set_page_load_timeout(10)
self.driver.maximize_window()
self.url ='https://sf.taobao.com/item_list.htm' def scrapy_date(self):
try:
self.driver.get(self.url) selenium_html = self.driver.execute_script("return document.documentElement.outerHTML")
doc = pq(selenium_html)
Elements = doc('ul[class="sf-pai-item-list"]').find('li[class="pai-item pai-status-doing"]')
for element in Elements.items():
priceinfo = element('div[class="info-section"]').find('p').text().encode('utf8').strip()
title = element('div[class="header-section "]').find('p').text().encode('utf8').strip()
print title
print priceinfo
print '--------------------------------------------------------------------------------' except Exception, e:
print e.message
finally:
pass obj = taobao()
obj.scrapy_date()

  抓取结果

phantomjs 抓取房产信息的更多相关文章

  1. NodeJS + PhantomJS 抓取页面信息以及截图

    利用PhantomJS做网页截图经济适用,但其API较少,做其他功能就比较吃力了.例如,其自带的Web Server Mongoose最高只能同时支持10个请求,指望他能独立成为一个服务是不怎么实际的 ...

  2. [Python爬虫] 之十一:Selenium +phantomjs抓取活动行中会议活动信息

    一.介绍 本例子用Selenium +phantomjs爬取活动行(http://www.huodongxing.com/search?qs=数字&city=全国&pi=1)的资讯信息 ...

  3. C#使用Selenium+PhantomJS抓取数据

    本文主要介绍了C#使用Selenium+PhantomJS抓取数据的方法步骤,具有很好的参考价值,下面跟着小编一起来看下吧 手头项目需要抓取一个用js渲染出来的网站中的数据.使用常用的httpclie ...

  4. [Python爬虫] 之十:Selenium +phantomjs抓取活动行中会议活动

    一.介绍 本例子用Selenium +phantomjs爬取活动树(http://www.huodongshu.com/html/find_search.html?search_keyword=数字) ...

  5. 网络爬虫: 从allitebooks.com抓取书籍信息并从amazon.com抓取价格(3): 抓取amazon.com价格

    通过上一篇随笔的处理,我们已经拿到了书的书名和ISBN码.(网络爬虫: 从allitebooks.com抓取书籍信息并从amazon.com抓取价格(2): 抓取allitebooks.com书籍信息 ...

  6. 网络爬虫: 从allitebooks.com抓取书籍信息并从amazon.com抓取价格(2): 抓取allitebooks.com书籍信息及ISBN码

    这一篇首先从allitebooks.com里抓取书籍列表的书籍信息和每本书对应的ISBN码. 一.分析需求和网站结构 allitebooks.com这个网站的结构很简单,分页+书籍列表+书籍详情页. ...

  7. PHP快速抓取快递信息

    <?php header("Content-type:text/html;charset=utf-8"); /** * Express.class.php 快递查询类 * @ ...

  8. CasperJS基于PhantomJS抓取页面

    CasperJS基于PhantomJS抓取页面 Casperjs是基于Phantomjs的,而Phantom JS是一个服务器端的 JavaScript API 的 WebKit. CasperJS是 ...

  9. .net抓取网页信息 - Jumony框架使用1

    往往在实际开发中,经常会用到一些如抓取网站信息之类的的操作,往往大家采用的是用一些正则的方式获取,但是有时候正则是很死板的,我们常常试想能不能使用jquery的选择器,获取符合自己要求的元素,然后进行 ...

随机推荐

  1. vue实现简单在线聊天

    vue实现简单在线聊天 引用mui的ui库,ES6的 fetch做网络请求 //html <!DOCTYPE html> <html> <head> <met ...

  2. shopnc 店铺二级分类添加商品

    $class_2 = $goods_class[$gc_id]['gc_parent_id']; $class_1 = $goods_class[$class_2]['gc_parent_id']; ...

  3. 三:Ionic Framework开发Android应用

    第一步:添加Android平台 ionic cordova platform add android 第二步:编译Android应用 中间等待的过程有点长,需要耐心等待,生成的apk此时可以复制至平板 ...

  4. Druid 架构

    本篇译自 Druid 项目白皮书部分内容( https://github.com/apache/incubator-druid/tree/master/publications/whitepaper/ ...

  5. firfox与about:config

    ¤什么是about:config¤about:config是Firefox的设置页面,Firefox提供了不少高级设置选项在这里以便让你可以更加详细地控制Firefox的运行方式.官方不推荐用户手工修 ...

  6. vue-music 关于Search(搜索页面)-- 搜索历史

    搜索历史展示每一次搜索过,并选中的关键字,保存数据到数组.搜索历史数据是需要在多个组件中共享的,所以保存在vuex 中 searchHistory 数组中,保存触发在搜索列表点击选中之后派发事件到se ...

  7. cookies和session区别

    session原理:1.session是保存在服务器端,理论上是没有是没有限制,只要你的内存够大   2.浏览器第一次访问服务器时会创建一个session对象并返回一个JSESSIONID=ID的值, ...

  8. 【leetcode】200. Number of Islands

    原题: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is s ...

  9. 使用phonegap开发安卓HLS播放软件解决方案

    目前使用phonegap开发的手机应用,很少涉及视频播放的功能,究其原因,主要是phonegap提供的API里面对视频播放功能支持度不够,当然播放音频一般情况下还是能够实现的,由于工作需要,自己研究了 ...

  10. EasyUI学习总结(五)——EasyUI组件使用(转载)

    本文转载自:http://www.cnblogs.com/xdp-gacl/p/4084520.html 一.EasyUI组件的简单介绍 easyUI提供了很多组件让我们使用,如下图所示: