利用selenium爬虫QQ空间说说

#coding:utf-8

import unittest
import time
from selenium import webdriver
from bs4 import BeautifulSoup


class seleniumTest(unittest.TestCase):
    user = ''  # 你的QQ号
    pw = ''  # 你的QQ密码

    def setUp(self):
        # 调试的时候用firefox比较直观
        # self.driver = webdriver.PhantomJS()
        try:
            self.driver = webdriver.Firefox()
        except Exception as e:
            print(e)

        try:
            self.driver = webdriver.Chrome()
        except Exception as e:
            print(e)

    def testEle(self):
        driver = self.driver
        # 浏览器窗口最大化
        driver.maximize_window()
        # 浏览器地址定向为qq登陆页面
        driver.get("http://i.qq.com")
        # 很多时候网页由多个或