Jump to content
Macro Express Forums

How To Grab A Url


chaz

Recommended Posts

how do i grab a URL from a website text

 

In Internet Explorer: use Alt+d (not shure about other browsers, but I assume they have a similar shortkey as well). Now the URL is selected, so you can copy it.

 

 

 

then grab a specific number from that

I'm not at the office with a real Macro Express so beware of typos.

Make a copy of the string variable containing the URL (here T90).

Find out where this page argument begins: find the position of ?page= in the URL.

Variable Set Integer %N90% from Position of Text in Variable %T90%

N90 + 6 is the first digit of the number you're looking for.

Get rid of everything before that point (that's why you should make a copy first). Copy from T90 to T90 beginning at the N90th character until the end of the string (the 99999th character).

Variable Modify String: Copy Part of %T90% to %T90%

 

Now you have to look for the first nonnumeric charcter (or the end of the string).

Repeat Count 99999, Start 1, Step 1, Place Counter in Variable N91

Repeat Start (Repeat 99999 times)

Copy from T90 to T91 1 character from Starting Position N91

  Variable Modify String: Copy Part of %T90% to %T91%

Loop until T91 contains another character, then break

  If Variable %T91% < "0"
   OR
 If Variable %T91% > "9"
   Break
 End If
Repeat End

 

N91 now holds the length of the number.

Copy from T90 to T90 N91 characters from Starting Position 1

Variable Modify String: Copy Part of %T90% to %T90%

Link to comment
Share on other sites

In IE use F6.

 

In the example you gave the number will be the last part of the URL so you don't need to check every character as wbeldman suggests.

Link to comment
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...