andymurray 2 Posted May 13, 2013 Report Share Posted May 13, 2013 Hello, I've been tinkering with Ubot for a few months now after purchasing Seth's WSO developer deal. And although this is my first post here on this forum, I'vetried to spend as much time as possible going throughall the tutorials and reading lots of posts. There's so much to learn But I'm very proud to be a part of this community and Iabsolutely love Ubot! So I was just wondering if anybody could help me with asmall problem... I'm trying to scrape the URL path for an image I've uploadedinto the media section on my wordpress blog. Tried every which way I can think of. Looks like it should bea doddle, but for the life of me I can't figure it out. Probably something really stupidly simple I've over looked. Here's the scrape code I get when I highlight the field boxwhere it resides: <input type="text" class="text urlfield" readonly="readonly" name="attachments[6]" value="http://lovethegreatoutdoors.com/wp-content/uploads/2013/05/TransparentLogo.gif"> And this is the from code view:set(#MSTransparentLogoURLPath, $scrape attribute(<url field>, "innerhtml"), "Global") In the node box under element to scrape it displays "<url field>. When I run the node, it doesn't scrape anything. Thank you in advance,Andy Quote Link to post Share on other sites
blacksabbath 2 Posted May 13, 2013 Report Share Posted May 13, 2013 When selecting the element to scrape, go into the advanced element editor. In the attribute drop down select value then delete everything that comes up replace it with a * and change exact match to Wildcard. Put the attribute to scape as innertext. I think that should work! Quote Link to post Share on other sites
andymurray 2 Posted May 13, 2013 Author Report Share Posted May 13, 2013 Hey thanks for your reply. Just tried it and it doesn't work. In the debugger it just createsa massive block of empty space. Thanks,Andy Quote Link to post Share on other sites
LazyBotter 188 Posted May 13, 2013 Report Share Posted May 13, 2013 Should you not be scraping the href? Quote Link to post Share on other sites
andymurray 2 Posted May 13, 2013 Author Report Share Posted May 13, 2013 I think I've tried all manner of combinations Just can't get that URL. Andy Quote Link to post Share on other sites
blacksabbath 2 Posted May 13, 2013 Report Share Posted May 13, 2013 I pulled it by using this: set(#MSTransparentLogoURLPath, $scrape attribute(<id="logo">, "src"), "Global") Let me know if that works for you! Quote Link to post Share on other sites
andymurray 2 Posted May 13, 2013 Author Report Share Posted May 13, 2013 It's still leaving a blank in the debugger for me. Andy Quote Link to post Share on other sites
blacksabbath 2 Posted May 13, 2013 Report Share Posted May 13, 2013 (edited) That has stumped me then, still working for me and I'm scraping it from lovethegreatoutdoors.com home page? set(#MSTransparentLogoURLPath, $scrape attribute(<id="logo">, "src"), "Global")navigate(#MSTransparentLogoURLPath, "Wait") Edit: Think I've been scraping the wrong image >.< my bad! Edited May 13, 2013 by blacksabbath Quote Link to post Share on other sites
andymurray 2 Posted May 13, 2013 Author Report Share Posted May 13, 2013 You gave me an idea. I've managed to get the URL if I 'view' the imagewithin a post, and scrape the url that way. Don'tknow why it's playing funny buggers within the field. At least I can get the URL now and hopefully I canachieve what I need to using this method. Thanks.Andy Quote Link to post Share on other sites
blacksabbath 2 Posted May 13, 2013 Report Share Posted May 13, 2013 That's okay, glad you've got something sorted! I was looking at the image on the homepage I think, obviously the wrong one Quote Link to post Share on other sites
andymurray 2 Posted May 13, 2013 Author Report Share Posted May 13, 2013 No you're right. In the header is a transparent logo gif to stop the title of the blog appearing over the header image. Thanks,Andy Quote Link to post Share on other sites
andymurray 2 Posted May 13, 2013 Author Report Share Posted May 13, 2013 Arghhhh! Now this presents me with another little problem. if I do it this way, it transfixes the image size in thepost to the variable, like so: #MSHeaderURLPath: http://lovethegreatoutdoors.com/wp-content/uploads/2013/05/header-300x75.jpg This is not good because obviously it whacks myheader out of shape. How would I go about deleting this extra bit of detail in theurl so I just get the 'header.jpg' Thanks,Andy Quote Link to post Share on other sites
blacksabbath 2 Posted May 13, 2013 Report Share Posted May 13, 2013 You'll need to use a substring I think to remove the -300x75.jpg! I'll take a look later if you like, just heading out! Quote Link to post Share on other sites
andymurray 2 Posted May 13, 2013 Author Report Share Posted May 13, 2013 Hey BlackSabbath, I found a different way around. The method of using the homepage for the image urls won'twork when I want to add images that will be present withinpages and posts. So, instead I've used the 'pagescrape' attribute. Works likea charm Really appreciate your help,Andy 1 Quote Link to post Share on other sites
blacksabbath 2 Posted May 14, 2013 Report Share Posted May 14, 2013 You're welcome, glad you got something sorted 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.