Jump to content

Having problems getting prefix and suffix for this web URL


This topic is 2876 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello

I have been succeeding at scraping my web URL and getting what I need. I ran into difficulty that I have been working on but I can't figure out how to do something on this web URL

 

I am looking to web scrape the Youtube URL and the vimeo

http://www.usachurches.org/church/the-miracle-center-san-antonio.htm

 

 and

twitter  URL from another page

http://www.usachurches.org/church/new-life-covenant-church-se.htm

 

 

When I go to the twitter field where the url should go I get

tml>
<!-- HTML5 Boilerplate -->
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7

 

I have tried everyway to get the areas enclosed I want to grab but It gives me bad answers.

 

I am using

 

Let ( [
text = GetLayoutObjectAttribute ( "webwindow" ; "content" ) ;
prefix ="_blank" href="";
suffix = "</";
start = Position ( text ; prefix ; 1 ; 1 ) + Length ( prefix ) ;
end = Position ( text ; suffix ; start ; 1 )
] ;
Middle ( text ; start ; end - start )
)

 

for youtube

 

I am using

 

Let ( [
text = GetLayoutObjectAttribute ( "webwindow" ; "content" ) ;
prefix ="_blank"href=";
suffix = "">";
start = Position ( text ; prefix ; 1 ; 1 ) + Length ( prefix ) ;
end = Position ( text ; suffix ; start ; 1 )
] ;
Middle ( text ; start ; end - start )
)

 

For twitter

 

 

and I am using

 

Let ( [
text = GetLayoutObjectAttribute ( "webwindow" ; "content" ) ;
prefix =""nofollow
" target="_blank" href="";
suffix = "<";
start = Position ( text ; prefix ; 1 ; 1 ) + Length ( prefix ) ;
end = Position ( text ; suffix ; start ; 1 )
] ;
Middle ( text ; start ; end - start )
)

 

 

for Vimeo

 

I have been able to apply everything with all the other fields and they all work fine. I understand the concept now but I can't figure out the enclosures to grab the urls.

 

Any help would be greatly appreciated.

Thank you

Link to comment
Share on other sites

if I understand your question... for Twitter, you're wanting the calculation to return what, in your second link, would be twitter.com/nlcsoutheast

this works.

 

Let ( [
original = GetLayoutObjectAttribute ( "webwindow" ; "content" ) ;
twitterpos = Position ( original; "twitter.com" ; 1; 1);
twitterend = Position (original; """ ;  twitterpos; 1)
] ;
Middle ( original ; twitterpos ; twitterend - twitterpos )
)

Link to comment
Share on other sites

This topic is 2876 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.