Re: [PHP] Parsing HTML href-Attribute

2009-01-18 Thread Micah Gersten
Depending on the goal, using the base tag in the head section might help: http://www.w3.org/TR/REC-html40/struct/links.html#h-12.4 Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Edmund Hertle wrote: > Hey, > I want to "parse" a href-attribute in a given Stri

Re: [PHP] Parsing HTML href-Attribute

2009-01-18 Thread Benjamin Hawkes-Lewis
On 16/1/09 23:41, Shawn McKenzie wrote: Again, I say that it won't work on URLs with spaces, like "my web page.html". When I get a minute I'll fix it. I thought spaces in URLs weren't valid markup, but it seems to validate. Some small points of information: An HTML4 validator will only check

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Eric Butera
On Fri, Jan 16, 2009 at 6:18 PM, Kevin Waterson wrote: > This one time, at band camp, Eric Butera wrote: > >> >> You could also use DOM for this. >> >> http://us2.php.net/manual/en/domdocument.getelementsbytagname.php > > http://www.phpro.org/examples/Get-Links-With-DOM.html > > > Kevin > > -- >

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Shawn McKenzie
Edmund Hertle wrote: >> * http://www.google.com/search?q=php ... absolute path (yes, it's a URL, >> but treat it as absolute) >> * https://www.example.com/index.php ... absolute path (yes, it's a URL, >> but to the local server) >> * /index.php ... absolute path (no protocol given, true absolute pa

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Kevin Waterson
This one time, at band camp, Eric Butera wrote: > > You could also use DOM for this. > > http://us2.php.net/manual/en/domdocument.getelementsbytagname.php http://www.phpro.org/examples/Get-Links-With-DOM.html Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: ht

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Kevin Waterson
This one time, at band camp, mike wrote: > On Fri, Jan 16, 2009 at 10:58 AM, mike wrote: > > > only if it's parseable xml :) > > > > Or not! Ignore me. Supposedly this can handle HTML too. I'll have to > try it next time. Normally I wind up having to use tidy to scrub a > document and try to g

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Edmund Hertle
> > * http://www.google.com/search?q=php ... absolute path (yes, it's a URL, > but treat it as absolute) > * https://www.example.com/index.php ... absolute path (yes, it's a URL, > but to the local server) > * /index.php ... absolute path (no protocol given, true absolute path) > * index.php ... re

RE: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Boyd, Todd M.
> -Original Message- > From: Shawn McKenzie [mailto:nos...@mckenzies.net] > Sent: Friday, January 16, 2009 2:37 PM > To: php-general@lists.php.net > Subject: Re: [PHP] Parsing HTML href-Attribute > > >>>>> Hey, I want to "parse" a href-a

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Shawn McKenzie
>> I believe the OP wanted to leave already-absolute paths alone >> (i.e., only convert relative paths). The regex does not take into >> account fully-qualified URLs (i.e., >> http://www.google.com/search?q=php) and it does not determine if a >> given path is relative or absolute. He was wanting to

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Shawn McKenzie
Boyd, Todd M. wrote: >> -Original Message- From: Shawn McKenzie >> [mailto:nos...@mckenzies.net] Sent: Friday, January 16, 2009 1:08 >> PM To: php-general@lists.php.net Subject: Re: [PHP] Parsing HTML >> href-Attribute >> >> Shawn McK

RE: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Boyd, Todd M.
> -Original Message- > From: Shawn McKenzie [mailto:nos...@mckenzies.net] > Sent: Friday, January 16, 2009 1:08 PM > To: php-general@lists.php.net > Subject: Re: [PHP] Parsing HTML href-Attribute > > Shawn McKenzie wrote: > > Boyd, Todd M. wrote:

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Shawn McKenzie
Shawn McKenzie wrote: > Boyd, Todd M. wrote: >>> -Original Message- >>> From: farn...@googlemail.com [mailto:farn...@googlemail.com] On Behalf >>> Of Edmund Hertle >>> Sent: Thursday, January 15, 2009 4:13 PM >>> To: PHP - General >>&g

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Eric Butera
On Fri, Jan 16, 2009 at 1:59 PM, mike wrote: > On Fri, Jan 16, 2009 at 10:58 AM, mike wrote: > >> only if it's parseable xml :) >> > > Or not! Ignore me. Supposedly this can handle HTML too. I'll have to > try it next time. Normally I wind up having to use tidy to scrub a > document and try to ge

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread mike
On Fri, Jan 16, 2009 at 10:58 AM, mike wrote: > only if it's parseable xml :) > Or not! Ignore me. Supposedly this can handle HTML too. I'll have to try it next time. Normally I wind up having to use tidy to scrub a document and try to get it into xhtml and then use simplexml. I wonder how well

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread mike
On Fri, Jan 16, 2009 at 10:54 AM, Eric Butera wrote: > You could also use DOM for this. > > http://us2.php.net/manual/en/domdocument.getelementsbytagname.php only if it's parseable xml :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Eric Butera
On Thu, Jan 15, 2009 at 5:13 PM, Edmund Hertle wrote: > Hey, > I want to "parse" a href-attribute in a given String to check if there is a > relative link and then adding an absolute path. > Example: > $string = ' href="/foo/bar.php" >'; > > I tried using regular expressions but my knowledge of R

Re: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Shawn McKenzie
Boyd, Todd M. wrote: >> -Original Message- >> From: farn...@googlemail.com [mailto:farn...@googlemail.com] On Behalf >> Of Edmund Hertle >> Sent: Thursday, January 15, 2009 4:13 PM >> To: PHP - General >> Subject: [PHP] Parsing HTML href-Attribute &g

RE: [PHP] Parsing HTML href-Attribute

2009-01-16 Thread Boyd, Todd M.
> -Original Message- > From: farn...@googlemail.com [mailto:farn...@googlemail.com] On Behalf > Of Edmund Hertle > Sent: Thursday, January 15, 2009 4:13 PM > To: PHP - General > Subject: [PHP] Parsing HTML href-Attribute > > Hey, > I want to "parse"

Re: [PHP] Parsing HTML href-Attribute

2009-01-15 Thread Murray
Hi Edmund, You want a regex that looks something like this: $result = preg_replace('%(href=)("|\')(?!c:/)(.+?)("|\')%', '\1\2c:/my_absolute_path\3\4', $subject); This example assumes that your absolute path begins with "c:/". You would change this to whatever suits. You would also change "c:/my_

[PHP] Parsing HTML href-Attribute

2009-01-15 Thread Edmund Hertle
Hey, I want to "parse" a href-attribute in a given String to check if there is a relative link and then adding an absolute path. Example: $string = ''; I tried using regular expressions but my knowledge of RegEx is very limited. Things to consider: - $string could be quite long but my concern are

Re: [PHP] Parsing HTML

2006-02-16 Thread Sumeet
Boby wrote: I need to extract news items from several news sites. In order to do that, I need to parse the HTML data. I know how to use Regular Expressions, but I wonder if there are other ways to do that. Can anybody please give me some pointers? i could suggest you to use html parsing l

RE: [PHP] Parsing HTML

2006-02-16 Thread Jay Blanchard
[snip] I need to extract news items from several news sites. In order to do that, I need to parse the HTML data. I know how to use Regular Expressions, but I wonder if there are other ways to do that. Can anybody please give me some pointers? [/snip] Can you be more specific here? This is awfu

[PHP] Parsing HTML

2006-02-16 Thread Boby
I need to extract news items from several news sites. In order to do that, I need to parse the HTML data. I know how to use Regular Expressions, but I wonder if there are other ways to do that. Can anybody please give me some pointers? -- PHP General Mailing List (http://www.php.net/) To uns

Re: [PHP] Parsing HTML files

2004-09-10 Thread Peter Brodersen
On Fri, 10 Sep 2004 11:58:58 +0100, in php.general [EMAIL PROTECTED] (Abdul-Wahid Paterson) wrote: >> I was wondering if any classes/functions could help me with this little >> challenge, (im hopeless at regex ;-) >> >> > >No easy way of doing it, regex somthing like: > >$id = preg_replace("/.*/

Re: [PHP] Parsing HTML files

2004-09-10 Thread Nick Wilson
* and then Abdul-Wahid Paterson declared > No easy way of doing it, regex somthing like: > > $id = preg_replace("/.*/", $1, $string); > > where $string is a line from your input'd HTML page OK, thanks abdul, much appreciated.. -- Nick W -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Parsing HTML files

2004-09-10 Thread Abdul-Wahid Paterson
No easy way of doing it, regex somthing like: $id = preg_replace("/.*/", $1, $string); where $string is a line from your input'd HTML page Abdul-Wahid On Fri, 10 Sep 2004 12:54:37 +0200, Nick Wilson <[EMAIL PROTECTED]> wrote: > Hi all, > > I was wondering if any classes/functions could help

[PHP] Parsing HTML files

2004-09-10 Thread Nick Wilson
Hi all, I was wondering if any classes/functions could help me with this little challenge, (im hopeless at regex ;-) I want to extract the value of 'id' from a webpage. Any simple way to do this or am I down to sweating of the regex functions? Much thanks -- Nick W -- PHP General Maili

Re: [PHP] Parsing html to extract images

2003-05-29 Thread David Grant
Hidrahyl wrote: Hi, anyone can help me parsing html files in order to get all the images containing a file? Thanks, Simon. 1. Use fopen() to grab the HTML file you're after. 2. Read in each line to an array using file(); 3. Loop through the array, and apply the following reg. exp.: preg_match("/\

[PHP] Parsing html to extract images

2003-05-29 Thread Hidrahyl
Hi, anyone can help me parsing html files in order to get all the images containing a file? Thanks, Simon. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Parsing HTML

2002-10-28 Thread Henry
Hi All, I would like to be able to do a serach and replace in a HTML document. For a list of words; for example: hello become buongiorno yes becomes si size become grossezza The problem is that if I change the word "size" without considering html tags and html comments in the case of inline java

[PHP] parsing HTML text

2002-05-07 Thread Lee Doolan
I have written form screen which has as one of it's elements a box in which a user can input some text --like a simple bio-- which will appear on another screen. I'd like to edit check this text. It would be a good idea to make sure that it has, among other things, no elements, say, or to mak

[PHP] Parsing HTML

2001-11-29 Thread Ulrich Hacke
Hi, I have some HTML including several pseudo tags like After parsing I have an array $content[$i]["name"] where "name" is the name of the parameters and $i the Counter of the tag. I'm using a regular expression to find these tags and explode(" ", $my_tag_line) to geht the parameters out. How ca

Re: Fwd: Re: [PHP] Parsing html table into MySQL

2001-09-16 Thread Christian Dechery
me :) >> >> >> >>- Original Message - >>From: "Christian Dechery" <[EMAIL PROTECTED]> >>To: "i_union" <[EMAIL PROTECTED]>; "Chris Lambert" <[EMAIL PROTECTED]> >>Cc: <[EMAIL PROTECTED]> >>Se

Re: [PHP] Parsing html table into MySQL

2001-09-16 Thread i_union
[EMAIL PROTECTED]> Sent: Monday, September 10, 2001 7:57 PM Subject: Re: [PHP] Parsing html table into MySQL > wait a minute... do you want to parse the HTML to get the values to > populate a mysql table, or do you have this table in another DB and just > want it copied to your mysql

Re: [PHP] Parsing html table into MySQL

2001-09-16 Thread Christian Dechery
wait a minute... do you want to parse the HTML to get the values to populate a mysql table, or do you have this table in another DB and just want it copied to your mysql one?? If it is the former, you'll some very hardcore regex work to be done... I once did this... it is very stressing work..

[PHP] Parsing html table into MySQL

2001-09-16 Thread i_union
I need to get from another page table and put it into MySQL table dynamically for example http://66.96.230.191/table.html so I need to parse this table in database. If you have any code how to implement such operation by using php MySQL please help me; thanks in advance __

Re: [PHP] Parsing HTML files?

2001-07-07 Thread Chris Lambert - WhiteCrown Networks
IL PROTECTED]> Sent: Saturday, July 07, 2001 2:18 PM Subject: [PHP] Parsing HTML files? | Is it possible to parse an HTML like at: | http://hyrum.net/wwbl/HTML/watrost.htm ? | | I'd like to be able to grab the player name and ratings and add them to a | "pretty" HTML output :) | |

RE: [PHP] Parsing HTML files?

2001-07-07 Thread Maxim Maletsky
PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Jeff Lewis [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 08, 2001 3:19 AM To: [EMAIL PROTECTED] Subject: [PHP] Parsing HTML files? Is it possible to parse an HTML like at: http://hyrum.net/wwbl/HTML

[PHP] Parsing HTML files?

2001-07-07 Thread Jeff Lewis
Is it possible to parse an HTML like at: http://hyrum.net/wwbl/HTML/watrost.htm ? I'd like to be able to grab the player name and ratings and add them to a "pretty" HTML output :) Jeff

[PHP] Parsing HTML files from an external web server

2001-04-26 Thread James Kneebone
Hello List. I'm having a little trouble with parsing HTML files and inputting the data from the HTML file into a MySQL database. I get the following error when trying toparse the file. Warning: file("http://www.server.com/file.htm";) - No error in d:\webpages\world\lists.php on line 8 The follo

[PHP] Parsing HTML files from an external web server

2001-04-25 Thread James Kneebone
Hello List. I'm having a little trouble with parsing HTML files and inputting the data from the HTML file into a MySQL database. I get the following error when trying toparse the file. Warning: file("http://www.server.com/file.htm";) - No error in d:\webpages\world\lists.php on line 8 The follo

Re: [PHP] Parsing HTML tags

2001-04-13 Thread Tobias Talltorp
// Get the webpage into a string $html = join ("", file ("http://www.altavista.com")); // Using eregi eregi("(.*)", $html, $tag_contents); // Using preg_match (faster than eregi) // The i in the end means that it is a case insensitive match preg_match("/(.*)<\/title>/i", $html, $tag_contents);

RE: [PHP] Parsing HTML tags

2001-04-13 Thread Brian Paulson
it won't get the title either. hth Thank you Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com 1-800-269-6397 -Original Message- From: Chris Empson [mailto:[EMAIL PROTECTED]] Sent: Friday, April 13, 2001 8:45 AM To: [EMAIL PROTECTED] Subject: [PHP] Parsing HTML

[PHP] Parsing HTML tags

2001-04-13 Thread Chris Empson
Could anyone tell me how to extract a string from between a pair of HTML tags? Specifically, I would like to extract the page title from between the and tags. I have read the regular expression docs and I'm still a bit stuck. Can anyone help? Thanks in advance, Chris Empson [EMAIL PROTE

RE: [PHP] parsing html / xml (more)

2001-03-08 Thread Bruin, Bolke de
onden: Wednesday, March 07, 2001 9:39 PM Aan: '[EMAIL PROTECTED]' Onderwerp: RE: [PHP] parsing html / xml (more) Matt McClanahan wrote: [...] > You're not going to find an XML parser that allows for most HTML, > because if such a parser did exist, it would be a broken XML parser.

RE: [PHP] parsing html / xml (more)

2001-03-07 Thread Nathaniel Hekman
Matt McClanahan wrote: [...] > You're not going to find an XML parser that allows for most HTML, > because if such a parser did exist, it would be a broken XML parser. :) [...] Fair enough, and that's as I expected. So that brings me to the second part of my question: is there any php library t

RE: [PHP] parsing html / xml

2001-03-07 Thread Angerer, Chad
Try here to take care of problems.. http://www.w3.org/People/Raggett/tidy/ Chad -Original Message- From: Nathaniel Hekman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 10:57 AM To: '[EMAIL PROTECTED]' Subject: [PHP] parsing html / xml I'd like to parse

Re: [PHP] parsing html / xml (more)

2001-03-07 Thread Matt McClanahan
On Wed, Mar 07, 2001 at 10:07:37AM -0700, Nathaniel Hekman wrote: > Here's another case that shows up often in html, but is illegal in xml, that > I would need to parse: meta tags, tags, tags, and other > "singletons". > > > > > > xml_parse would give an error, because t

[PHP] parsing html / xml (more)

2001-03-07 Thread Nathaniel Hekman
"block". Nate -Original Message- From: Nathaniel Hekman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 9:57 AM To: '[EMAIL PROTECTED]' Subject: [PHP] parsing html / xml I'd like to parse a html file in much the same way the xml parser works. Ie calling a me

[PHP] parsing html / xml

2001-03-07 Thread Nathaniel Hekman
I'd like to parse a html file in much the same way the xml parser works. Ie calling a method for every tag encountered and so on. The xml parsing methods don't seem to be forgiving enough for much of the html that's out there. For example, many html files have tags like this: but xml