Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. from scrapy.selector import Selector
  2. from scrapy.http import HtmlResponse
  3.  
  4. response = HtmlResponse(url='https://en.wikipedia.org/wiki/Pan_American_Games')
  5. datas = Selector(response=response).xpath('//div[@class="thumb tleft"]')
  6.  
  7. from urllib2 import urlopen
  8. from lxml import html
  9.  
  10. response = urlopen('https://en.wikipedia.org/wiki/Pan_American_Games')
  11. page = html.fromstring(response.read())
  12. datas = page.xpath('//div[@class="thumb tleft"]')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement