3

I'm getting list of offered jobs on this site: http://telekom.jobs/global-careers

I'm trying to get XPath of link to get more info about job.

Here is the whole XPath to the first link:

/html/body/div[3]/div/div[2]/div[3]/table/tbody/tr[2]/td/div/a/@href

and this is what I should paste to import.io:

tr[2]/td/div/a/@href

But it doesn't work, I don't know why.

Links to more info about job offer pages are having XPath:

tr[2]/td/div/a/@href
tr[4]/td/div/a/@href
tr[6]/td/div/a/@href
tr[8]/td/div/a/@href

and so on. Maybe that's why it doesn't work? Because the numbers arent 1,2,3 etc but 2,4,6? Or do I do something wrong?

2
  • 1
    Do you know that the links are generated with Javascript ? Commented Jan 7, 2015 at 20:10
  • @sputnick yes, and does it change anything? If i paste to import.io '//tr[2]/td/div/a/@href' this shows link to the first job but in every row.
    – Marcin
    Commented Jan 8, 2015 at 12:32

1 Answer 1

5

If you create an API from from URL 2.0 and reload the website with JS on but CSS off you should be able to see the collapsible menu:

DOM is constructed in such a way on this website that all the odd rows have job titles whereas more information about the job is hidden in the even rows. For that we can use position() property of XPath, so you can use the following XPath on manual row training:

/html/body/div[3]/div/div[2]/div[3]/table/tbody/tr[position() mod 2 = 0]

Which highlights the more information boxes only giving you access to the data inside. From here you can simply target the specific attributes of the elements that have title and link available.

Link xpath: .//a[@class=’forward jobadview’]/@href Title xpath: .//div[@class=’info’]//h3

Having said that due to the heavy use of JS on the website, it may fail to publish so we have created an API for you to query and you can retrieve the same data using that here.

https://import.io/data/mine/?id=0626d49d-5233-469d-9429-707f73f1757a

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.