Skip to content
Advertisement

XPath doesn’t locate element

I want to scrape links from this page. https://www.youtube.com/results?search_query=food+recepies

JavaScript

None of these works for me.

JavaScript

Advertisement

Answer

This should work for the title.

JavaScript

However, there are 27 of them. So, you might want to use

JavaScript

Another thing is that you might want to wait until the elements are visible, enabled, clickable, etc., on the page. For this, you need to do something like the following:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement