How to scrape data using X-path in Scrapy?

python

#1

Hi,

I am trying to scrape job description data from following page:

https://jobs.theguardian.com/job/6747209/cruk-icep-research-associate-senior-research-associate-in-cancer-bioinformatics-mrc-integrative-epid/?LinkSource=PremiumListing

We can see there is class called: “block fix-text job-description”
I tried following methods:

  1. ‘//*[@class=“job-description”]’
  2. //[@id=“main”]/div/div/div[1]/div[1]/div/div[2]/div[2]//text()
  3. ‘//[@id=“main”]//div[@class=“job-description”]/
  4. //div[@class=“job-description”]/p/text()

Can anyone please tell me how to scrape Job description because its under so many p tags?
Thank you so much in advance


#2

Resolved this problem

My Xpath is following:

//*[contains(@class,"job-description")]/descendant::text()'

It will take all text from class child.