New to python/scrapy. I am testing responses via xpath in the console and am able to print the h1 header as a test using the code below. Now I am trying to select the xpath to pull the (1) job title, (2) job URL
Here is my console code:
r = scrapy.Request(url='https://www.northropgrumman.com/jobs?remote=yes-may-consider-full-time-teleworking-for-this-position&country=united-states-of-america&_job_category=global-supply-chain,business-management,program-management')
fetch(r)
#this works and pulls "Job Search" header at top of page
response.xpath('//h1/text()').getall()
# broken, tried many combos of xpaths to get job title and url
response.xpath("/html/body/div[1]/main/div[2]/div/div/div[3]/div[2]/div/div/div/div/div[1]/div[1]/div/div/div/div/div/div/div[1]/a/text()").getall()
What is the xpath for job titles and job URLs on the jobs listed on this page?
XPath for job titles could be :
//div[@class="col-sm-9"]/a/@hrefFor job URLs :
//div[@class="col-sm-9"]/a/h2/text()One liner for both :
//div[@class="col-sm-9"]/a/@href|//div[@class="col-sm-9"]/a/h2/text()Results :