web-scrapingimacros

scrape the data-title and data-video-id on single page


I want to scrape the data-title and data-video-id but i don't know how to write the script with imacros

The Photos


Solution

  • Try this:

    SET !EXTRACT_TEST_POPUP NO
    TAG POS=1 TYPE=TR ATTR=CLASS:pl-video<SP>yt-uix-tile* EXTRACT=HTM
    SET data-title EVAL("'{{!EXTRACT}}'.match(/data-title=\"(.*?)\"/)[1]")
    SET data-video-id EVAL("'{{!EXTRACT}}'.match(/data-video-id=\"(.*?)\"/)[1]")
    SET !EXTRACT {{data-title}}[EXTRACT]{{data-video-id}}
    PROMPT {{!EXTRACT}}