Kurt 1 Posted April 12, 2010 Report Share Posted April 12, 2010 I have a page of relative URLs scraped from Youtube: /watch?v=MHeX6yg95xU/watch?v=4V4c1nsjc9o/watch?v=_drEFOaPaK8/watch?v=yknBPGkhPgE How do I change the list of relative URLs into absolute URLs like below so each can be navigated to? http://youtube.com/watch?v=4V4c1nsjc9o I've tried $replace, but must be doing something wrong. Quote Link to post Share on other sites
Joe118 3 Posted April 12, 2010 Report Share Posted April 12, 2010 Do: set #theabsoluteURL "http://youtube.com/{1}" with {1} being substituted by a variable containing /watch?v=MHeX6yg95xU etc. I have a page of relative URLs scraped from Youtube: /watch?v=MHeX6yg95xU/watch?v=4V4c1nsjc9o/watch?v=_drEFOaPaK8/watch?v=yknBPGkhPgE How do I change the list of relative URLs into absolute URLs like below so each can be navigated to? http://youtube.com/watch?v=4V4c1nsjc9o I've tried $replace, but must be doing something wrong. 1 Quote Link to post Share on other sites
Kurt 1 Posted April 12, 2010 Author Report Share Posted April 12, 2010 Do: set #theabsoluteURL "http://youtube.com/{1}" with {1} being substituted by a variable containing /watch?v=MHeX6yg95xU etc. Thanks Joe, I appreciate it. When do I set #theabsoluteURL{1} ? Do I add it to a list or to the navigation? Sorry, but I'm still a noob with ubot. Quote Link to post Share on other sites
Kurt 1 Posted April 12, 2010 Author Report Share Posted April 12, 2010 I'd really appreciate if someone can help me out...I've spent a good day and a half on this single problem. Attached is a ubot script that will search ubot and scrape the URLs and save them to a file. Problem is, it saves them as:/watch?v=MHeX6yg95xU/watch?v=4V4c1nsjc9o/watch?v=_drEFOaPaK8/watch?v=yknBPGkhPgE I need them to be so each page can be navigated to (and then scraped): http://youtube.com/watch?v=4V4c1nsjc9o Can anyone please help? I've got the rest of the script finished, but have been hung up on this issue for a while...YouTube_SERP_URLs.ubot Quote Link to post Share on other sites
Kurt 1 Posted April 12, 2010 Author Report Share Posted April 12, 2010 PS...I've tried the obvious, logical way, which is: Save to file => Content to savehttp://youtube.com{1} ...where {1} is the list containing the relative links. However, when I try this, it doesn't write anything to the file. Quote Link to post Share on other sites
gwen 5 Posted April 12, 2010 Report Share Posted April 12, 2010 is this what you are trying to do?? youtube.ubot did you scraped this "watch?v=yknBPGkhPgE" if so, why not scrape the whole url (href) it's much easier. hope this help.. by the way, if you want to try the attached bot, you need to edit the path where you want to save full urls 3 Quote Link to post Share on other sites
Kurt 1 Posted April 12, 2010 Author Report Share Posted April 12, 2010 is this what you are trying to do?? youtube.ubot did you scraped this "watch?v=yknBPGkhPgE" if so, why not scrape the whole url (href) it's much easier. hope this help.. by the way, if you want to try the attached bot, you need to edit the path where you want to save full urls Hi Gwen, Thanks a lot...I'll give your script a try. The reason I didn't scrape the whole URL is because I don't see them in the Youtube SERPs: http://www.youtube.com/results?search_query=test&aq=f Quote Link to post Share on other sites
Kurt 1 Posted April 13, 2010 Author Report Share Posted April 13, 2010 Hey Gwen, I got your script to work, and I should be able to add it to the rest of the bot. Thanks again, I really appreciate it. Quote Link to post Share on other sites
gwen 5 Posted April 13, 2010 Report Share Posted April 13, 2010 Hey Gwen, I got your script to work, and I should be able to add it to the rest of the bot. Thanks again, I really appreciate it. if you want to scrape the whole url maybe try this one youtube2.ubot 2 Quote Link to post Share on other sites
Kurt 1 Posted April 13, 2010 Author Report Share Posted April 13, 2010 if you want to scrape the whole url maybe try this one youtube2.ubot Thanks again Gwen, that works even better. And I learned a good lesson too. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.