04-26-2012
How to remove urls from html files
Does anybody know how to remove all urls from html files?
all urls are links with anchor texts in the form of
<a href="http://www.anydomain.com">ANCHOR</a>
they may start with www or not.
Goal is to delete all urls and keep the ANCHOR text and if possible to change tags around anchor to <strong> or <em>.
any help is greatly appreciated
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
is there a way to go through a file and remove certain html tags with bash? If it needs sed or awk, that'll do too.
The reason why I want this is, because I have a monitor script which generates a logfile in HTML and every time it generates a logfile, the tags are reproduced. The tags... (4 Replies)
Discussion started by: dejavu88
4 Replies
2. Shell Programming and Scripting
Hello,
i try to extract urls from google-search-results, but i have problem with sed filtering of html-code.
what i wont is just list of urls thay apears between ........<p><a href=" and next following " in html code.
here is my code, i use wget and pipelines to filtering. wget works, but... (13 Replies)
Discussion started by: L0rd
13 Replies
3. Shell Programming and Scripting
Hello,
I have one file which has been inserted intermittently with HTML web page.
I would like to remove all text between "<html xmlns="http://www.w3.org/1999/xhtml">" and </html> tags.
Can any one please suggest me sed regular expression for it.
Thanks (3 Replies)
Discussion started by: nrbhole
3 Replies
4. Shell Programming and Scripting
Hi,
I need to basically get a list of all the tarballs located at uri
I am currently doing a wget on urito get the index.html page
Now this index page contains the list of uris that I want to use in my bash script.
can someone please guide me ,.
I am new to Linux and shell scripting.
... (5 Replies)
Discussion started by: mnanavati
5 Replies
5. Shell Programming and Scripting
Hi everyone. I have an html file with lines like so:
link href="localFolder/...">
link href="htp://...">
img src="localFolder/...">
img src="htp://...">
I want to remove the links with http in the href and imgs with http in its src. I'm having trouble removing them because there... (4 Replies)
Discussion started by: CowCow339
4 Replies
6. Shell Programming and Scripting
Hello,
I just saw that on my vps (centOS) my oscommerce with a seo script
has created millions of tmp files inside the /html/cache/ directory.
I would need to remove all those files (millions), I tried via shell but the vps
loads goes to very high and it hangs, is there some way to do a... (7 Replies)
Discussion started by: andymc1
7 Replies
7. Shell Programming and Scripting
Does anybody know how i can remove string from <a> tag?
There are several hundred posts in a few forums that need to be cleaned up.
The precise situation is
----------
<a href="http://mydomain.com/cgi-bin/anyboard.cgi?fvp=/family/sexuality_and_spirituality/&cmd=rA&cG=43">
-------------
my... (6 Replies)
Discussion started by: georgi58
6 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
How might I go about writing a program that will read all input as an HTML file, and subsequently strip all HTML, embedded scripts and style sheets from its input, leaving only text as the output?
I am a beginner, so the simpler, the better.
Thanks for any advice :) (4 Replies)
Discussion started by: Molly.P.
4 Replies
9. Shell Programming and Scripting
Hi,
I have a txt file which contain this:
<a href="linux">Linux</a>
<a href="unix">Unix</a>
<a href="oracle">Oracle</a>
<a href="perl">Perl</a>
I'm trying to extract the text in between these anchor tag and ignoring everything else using grep. I managed to ignore the tags but unable to... (6 Replies)
Discussion started by: KCApple
6 Replies
10. Shell Programming and Scripting
Hi,
I am looking for a regex that will validate a URL and files accessed in a browser.
For example:http://www.google.co.uk
http://www.google.com
https://www.google.co.uk
https://www.google.com
ftp://
file:///somefile/on/a/server/accessed/from/browser/file.txt
So far I have:
... (4 Replies)
Discussion started by: muay_tb
4 Replies
LEARN ABOUT PHP
curl_multi_info_read
CURL_MULTI_INFO_READ(3) 1 CURL_MULTI_INFO_READ(3)
curl_multi_info_read - Get information about the current transfers
SYNOPSIS
array curl_multi_info_read NULL (resource $mh, [int &$msgs_in_queue])
DESCRIPTION
Ask the multi handle if there are any messages or information from the individual transfers. Messages may include information such as an
error code from the transfer or just the fact that a transfer is completed.
Repeated calls to this function will return a new result each time, until a FALSE is returned as a signal that there is no more to get at
this point. The integer pointed to with $msgs_in_queue will contain the number of remaining messages after this function was called.
Warning
The data the returned resource points to will not survive calling curl_multi_remove_handle(3).
PARAMETERS
o $mh
-A cURL multi handle returned by curl_multi_init(3).
o $msgs_in_queue
- Number of messages that are still in the queue
RETURN VALUES
On success, returns an associative array for the message, FALSE on failure.
Contents of the returned array
+-------+---------------------------------------------------+
| Key: | |
| | |
| | Value: |
| | |
+-------+---------------------------------------------------+
| | |
| msg | |
| | |
| | The CURLMSG_DONE constant. Other return values |
| | are currently not available. |
| | |
| | |
|result | |
| | |
| | One of the CURLE_* constants. If everything is |
| | OK, the CURLE_OK will be the result. |
| | |
| | |
|handle | |
| | |
| | Resource of type curl indicates the handle which |
| | it concerns. |
| | |
+-------+---------------------------------------------------+
EXAMPLES
Example #1
A curl_multi_info_read(3) example
<?php
$urls = array(
"http://www.cnn.com/",
"http://www.bbc.co.uk/",
"http://www.yahoo.com/"
);
$mh = curl_multi_init();
foreach ($urls as $i => $url) {
$conn[$i] = curl_init($url);
curl_setopt($conn[$i], CURLOPT_RETURNTRANSFER, 1);
curl_multi_add_handle($mh, $conn[$i]);
}
do {
$status = curl_multi_exec($mh, $active);
$info = curl_multi_info_read($mh);
if (false !== $info) {
var_dump($info);
}
} while ($status === CURLM_CALL_MULTI_PERFORM || $active);
foreach ($urls as $i => $url) {
$res[$i] = curl_multi_getcontent($conn[$i]);
curl_close($conn[$i]);
}
var_dump(curl_multi_info_read($mh));
?>
The above example will output something similar to:
array(3) {
["msg"]=>
int(1)
["result"]=>
int(0)
["handle"]=>
resource(5) of type (curl)
}
array(3) {
["msg"]=>
int(1)
["result"]=>
int(0)
["handle"]=>
resource(7) of type (curl)
}
array(3) {
["msg"]=>
int(1)
["result"]=>
int(0)
["handle"]=>
resource(6) of type (curl)
}
bool(false)
CHANGELOG
+--------+---------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------+
| 5.2.0 | |
| | |
| | $msgs_in_queue was added. |
| | |
+--------+---------------------------+
SEE ALSO
curl_multi_init(3).
PHP Documentation Group CURL_MULTI_INFO_READ(3)