Sign in to follow this  
Followers 0
Altainta

Regex

7 posts in this topic

#1 ·  Posted (edited)

Well after a lot of scratcing my head now i am in need of help

Get all the LINKS ONLY! and process every one after a specific time (in other embeded object)

it gets the links but it also contains the links i do not want i want it to match a pattern like using regex but i do not know how to implement Regex in the Getlinkcollection

i want to only add the links for example

http://example.com/links.php?view=4556
http://example.com/links.php?view=2891
http://example.com/links.php?view=4221
http://example.com/links.php?view=9
http://example.com/links.php?view=22

After getting this they should be executed after specific time and than it should be closed after a specific time.

Edited by Altainta

Share this post


Link to post
Share on other sites



Hi,

what should the pattern do?

before :

after :

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thx for replying

Okay let me explain

1) Open a url

2) fetch all the Links from the URL

there are links such as

http://example.com/abt.php
http://example.com/guide.php
http://example.com/links.php?view=4556
http://example.com/links.php?view=2891
http://example.com/check.php
http://example.com/links.php?view=4221
http://example.com/get.php
http://example.com/links.php?view=9
http://example.com/links.php?view=22
http://example.com/end.php

Now this is the Data

i want it to fetch only the

http://example.com/links.php?view=*.*

(it might be stupid i put *.* but in windows language it means all that matches after that i.e after "view=")

Collect the links store in var

Here it should Open only one Link Not more than that...

After opening it should wait for a specific time than it should close the Opened Link.. than execute the Next link in the var

Also it should return a error if links not found...

Edit Updated last Lines.

Edited by Altainta

Share this post


Link to post
Share on other sites

Hi,

I guess this pattern should help

.*\?.*

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Really a noob question but how to use that ?

http://example.com/links.php?view=.*\?.*

Means what should do like

How to use it in a loop function which can also do the execute wait and kill the executed link window.

Exactly what is the code

Edited by Altainta

Share this post


Link to post
Share on other sites

Hi,

I thought you olny needed the ones with view= ...

Global $str[10] = ['http://example.com/abt.php', _
        'http://example.com/guide.php ', _
        'http://example.com/links.php?view=4556 ', _
        'http://example.com/links.php?view=2891 ', _
        'http://example.com/check.php ', _
        'http://example.com/links.php?view=4221 ', _
        'http://example.com/get.php ', _
        'http://example.com/links.php?view=9 ', _
        'http://example.com/links.php?view=22 ', _
        'http://example.com/end.php']

For $i = 0 To UBound($str) - 1
    If StringRegExp($str[$i], '(?i)http://.*\?\S+', 0) = 1 Then MsgBox(0, 'Matched', $str[$i])
Next

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Well thx for the Reply but i got the solution when i looked to the regex it was too much time consuming..

$oIE = _IECreate("http://example.com/links.php")
$oLinks = _IELinkGetCollection ($oIE )
For $oLink In $oLinks
    $str = $oLink.href
If (StringRegExp($str, 'view=\d', 0) = 1) Then FileWriteLine("text.txt",$str)
Next

But now a new problem

For this to work i am having a problem... (it works fien but how can i implement)

My MAIN program Log in to the account like

$oIE = _IECreate("http://example.com/login.php")

Now after login i need the links of

http://example.com/links.php

for this i need to reset the value of

$oIE = _IECreate("http://example.com/links.php")
which is already
$oIE = _IECreate("http://example.com/login.php")
how can i do that ?

It should not open a new window it should and must navigate to links.php in the same ie session..

Edited by Altainta

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0