Jump to content
UBot Underground

Scrape file URL for location of image in Wordpress?


Recommended Posts

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've

tried to spend as much time as possible going through

all 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 I

absolutely love Ubot!

 

So I was just wondering if anybody could help me with a

small problem...

 

I'm trying to scrape the URL path for an image I've uploaded

into the media section on my wordpress blog.

 

Tried every which way I can think of. Looks like it should be

a 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 box

where 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

 

 

Link to post
Share on other sites

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!

Link to post
Share on other sites

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 by blacksabbath
Link to post
Share on other sites

You gave me an idea.

 

I've managed to get the URL if I 'view' the image

within a post, and scrape the url that way. Don't

know why it's playing funny buggers within the field.

 

At least I can get the URL now and hopefully I can

achieve what I need to using this method.

 

Thanks.

Andy

Link to post
Share on other sites

Arghhhh!

 

Now this presents me with another little problem.

 

if I do it this way, it transfixes the image size in the

post 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 my

header out of shape.

 

How would I go about deleting this extra bit of detail in the

url so I just get the 'header.jpg'

 

Thanks,

Andy

Link to post
Share on other sites

Hey BlackSabbath,

 

I found a different way around.

 

The method of using the homepage for the image urls won't

work when I want to add images that will be present within

pages and posts.

 

So, instead I've used the 'pagescrape' attribute. Works like

a charm :)

 

Really appreciate your help,

Andy 

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...