python - How to scrape and extract similar xpaths onto different rows in csv using Scrapy -


I am facing a page that contains several H2 tags and I need all those titles That's stored in separate rows. My CSV sheet I am using scary for this and my current code is:

  items ["title"] = title. Selection ("// h2 / text ()"). Extract ()   

Obviously, it ends in a single cell in my CSV to store all the H2 tags on that page.

Is there any way by which I can break every H2 tag?

Thanks

You can loop on each h2 To set the "title" for each item, note the items starting with items

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -