I'd like to get contents of a website using JavaScript menu. I need to simulate clicks (or typing javascript:goto Page("p10"); into a browser) on menu links to be able to move from one page to another.
Basically the process will look like this:
while (any_content) {
file_get_conten ts();
clickalink();
}
Can cURL or JSON be used for this task?...
User Profile
Collapse
-
Javascript using link user click simulation
-
Doesn't it work with the current URL only, that means the one which the script is called from? I need it to be done with strings stored in an array. -
Getting relative URL out of an absolute one
I'd like to parse the URL part after TLD. In another words I'm interested in the bold part http://bytes.com/submit/304/ of this URL.
Let's assume that all the URLs are valid and formally flawless.
It seems to me one way is to make a regular expression like this: "anything, dot, 2 to 4 letters, slash, anything". The Regexp might look like this:
Is my thinking correct or am...Code:$regexp = '@.+\.[a-z]{2,4}\/(.+)@si'; -
Thank you very much, I'm interested in parsing out the URLs only, so I'll probably do that the same way you did it with the A tags. That means finding >href="< and >"< and then use substr() function.Leave a comment:
-
Extracting URL from a link containing a specific string
I'd like to get address of certain links with desired text. Let's say I want to get links containing a word "BMW".
...Code:<a href="http://abc.com/xxxx">Dodge</a> <a href="http://abc.com/a123.php">Used [B]BMW[/B] card</a> <a href="http://xyz.com/ferrari">Brand new Ferraris</a> <a href="http://xyz.com/vjklj"><img src="pic.jpg"
No activity results to display
Show More
Leave a comment: