# coding=utf-8
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as ui
from selenium.webdriver.common.action_chains import ActionChains
import time
import re
import os
import csv
#
打
开
Firefox
浏
览
器
driver = webdriver.Firefox()
i = 0
while i<1:
num = i*20
url = "https://movie.douban.com/subject/1292052/comments?start=" + st
print url
driver.get(url)
#
用
户
姓
名
超
链
接
elem1 = driver.find_elements_by_xpath("//div[@class='avatar']/a")
for n in elem1:
print n.get_attribute("title"),
print n.get_attribute("href")
#
用
户
评
分
elem2 = driver.find_elements_by_xpath("//span[@class='comment-info']/
for n in elem2:
print n.get_attribute("class"),
print n.get_attribute("title")
#
有
用
数
elem3 = driver.find_elements_by_xpath("//span[@class='comment-vote']/
for n in elem3:
print n.text
#
日
期
elem4 = driver.find_elements_by_xpath("//span[@class='comment-time ']
for n in elem4:
print n.text