Horje
get all tags inbetween   h2 tags Code Example
get all tags inbetween h2 tags
name_query = u"//*[name()=name(//*[@id='"+id+"'])]"
all = response.xpath(name_query)
for selector in all.getall():
     if self.id in selector:
          position = all.getall().index(selector)
balise = "h" + all.getall()[position].split("<h")[1][0]
title = all.getall()[position].split(">")[1].split("<")[0]
query = u"//*[preceding-sibling::"+balise+"[1] ='"+title+"' and following-sibling::"+balise+"]"
self.log('query = '+query)
results = response.xpath(query)
results.pop(len(results)-1)
with open(filename,'wb') as f:
    for text in results.css("::text").getall():
        f.write(text.encode('utf-8')+"\n")




Whatever

Related
ms keyboard editor issue Code Example ms keyboard editor issue Code Example
remake all with Make Code Example remake all with Make Code Example
ruby pry syntax Code Example ruby pry syntax Code Example
hthttps://www.google.com/search?q=https://www.google.com/search%3Fq%3Dweb+x5&sa=X&tbas=0&biw=1920&bih=969&dpr=1tps://www.google.com/search?q=web x5 Code Example hthttps://www.google.com/search?q=https://www.google.com/search%3Fq%3Dweb+x5&sa=X&tbas=0&biw=1920&bih=969&dpr=1tps://www.google.com/search?q=web x5 Code Example
twitch panel image size Code Example twitch panel image size Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8