0

This is the sibling/attribute

<h3 class="title-and-badge style-scope ytd-video-renderer">
              <ytd-badge-supported-renderer class="style-scope ytd-video-renderer" disable-upgrade="" hidden="">
              </ytd-badge-supported-renderer>
              <a id="video-title" class="yt-simple-endpoint style-scope ytd-video-renderer" aria-label="Using XPath to Locate Web Elements - in very detail by ABSoft Trainings 2 years ago 16 minutes 65,931 views" href="/watch?v=0ywu269mNyo" title="Using XPath to Locate Web Elements - in very detail">
                Using XPath to Locate Web Elements - in very detail
              </a>
            </h3>

I used: =importxml (A1, "//h3[@ class='yt-lockup-title']")to pull the title but i get an additional column with the duration of the video. I just want the title...

Here is my result: Tables and XML - Web scraping with Beautiful Soup 4 p.3 - Duration: 8:40.

I don't want the duration any suggestions?

Oscar
  • 1
  • 3
  • Please tidy your question because it is confusing. Replace that weird HTML scrap with your input XML. – Little Santi Sep 20 '17 at 14:12
  • Would it help us if you showed us where the result text comes from? There is no class='yt-lockup-title' in what appears to be intended to be the source. – Andrew Morton Sep 20 '17 at 18:36
  • @AndrewMorton https://www.youtube.com/results?q=scraping+with+xml&sp=EgIIBVAU this will take you to the page I'm tinkering with google sheets and how to import info... I used the importxml to get the title but the attribute also includes the duration of the video – Oscar Sep 20 '17 at 18:40
  • I don't have the time to watch all 935 videos. Perhaps you could put all the information we need to help you into your question here? – Andrew Morton Sep 20 '17 at 18:58
  • @AndrewMorton I was not asking you to watch but I realized my error when you mentioned the xquerry .... this is what my xpath_query should have been //h3/a[@ title] – Oscar Sep 20 '17 at 19:10

0 Answers0