selenium 爬虫

 from selenium import webdriver
import time driver = webdriver.PhantomJS(executable_path="D:/phantomjs/bin/phantomjs.exe")
driver.get("http://study.163.com/course/courseMain.htm?courseId=1002810012")
time.sleep(4)
data = driver.find_element_by_id('j-coursehead').text
a = data.find('\n')
b = data[a + 1:].find('\n')
num = data[a + 1:a + 1 + b]
driver.quit()
print('网易云课堂的销量为:',num)
上一篇:.NET中的文件IO操作实例


下一篇:opencv 中affine函数实现旋转和平移