Hi gang:
Here's the problem.
I have 184 HTML pages in a directory and each page contain a
question. The question is noted in the HTML DOM like so:
Who is Roger Rabbit?
My question is -- how can I extract the string "Who is Roger Rabbit?"
from each page using php? You see, I want to stor
On Sat, 2010-04-03 at 10:29 -0400, tedd wrote:
> Hi gang:
>
> Here's the problem.
>
> I have 184 HTML pages in a directory and each page contain a
> question. The question is noted in the HTML DOM like so:
>
>
>Who is Roger Rabbit?
>
>
> My question is -- how can I extract the string "W
I use this: http://simplehtmldom.sourceforge.net/
Check it out.
Thanks,
Vikash Kumar
--
http://vika.sh
On Sat, Apr 3, 2010 at 8:28 PM, Ashley Sheridan
wrote:
> On Sat, 2010-04-03 at 10:29 -0400, tedd wrote:
>
> > Hi gang:
> >
> > Here's the problem.
> >
> > I have 184 HTML pages in a director
>
>
> Who is Roger Rabbit?
>
>
> My question is -- how can I extract the string "Who is Roger Rabbit?" from
> each page using php? You see, I want to store the questions in a database
> without having to re-type, or cut/paste, each one.
>
I have not found/created a working example of this usin
On Sat, 03 Apr 2010 08:58:44 -0600, Ashley Sheridan
wrote:
On Sat, 2010-04-03 at 10:29 -0400, tedd wrote:
Hi gang:
Here's the problem.
I have 184 HTML pages in a directory and each page contain a
question. The question is noted in the HTML DOM like so:
Who is Roger Rabbit?
My quest
On Sat, 2010-04-03 at 08:11 -0600, Peter Pei wrote:
> On Sat, 03 Apr 2010 08:58:44 -0600, Ashley Sheridan
> wrote:
>
> > On Sat, 2010-04-03 at 10:29 -0400, tedd wrote:
> >
> >> Hi gang:
> >>
> >> Here's the problem.
> >>
> >> I have 184 HTML pages in a directory and each page contain a
> >> qu
No javascript's getElementByID() won't work here. As "question" is a
class, not an ID. But like what was mentioned here, you can use
getElementByClass() with Opera, and that will work.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Am 03.04.2010 16:29, schrieb tedd:
> Hi gang:
>
> Here's the problem.
>
> I have 184 HTML pages in a directory and each page contain a question.
> The question is noted in the HTML DOM like so:
>
>
> Who is Roger Rabbit?
>
>
> My question is -- how can I extract the string "Who is Roger Rab
On 03.04.2010 16:29, tedd wrote:
> Hi gang:
>
> Here's the problem.
>
> I have 184 HTML pages in a directory and each page contain a question.
> The question is noted in the HTML DOM like so:
>
>
> Who is Roger Rabbit?
>
>
> My question is -- how can I extract the string "Who is Roger Rabbit?"
If you are open to use javascript then a js library like jQuery may help in
selecting all elements from a particular class.
$(".clasName")
Thanks,
Vikash Kumar
--
http://vika.sh
On Sat, Apr 3, 2010 at 8:46 PM, Piero Steinger wrote:
> On 03.04.2010 16:29, tedd wrote:
> > Hi gang:
> >
> > Here
Yes, because Opera is pretty much leading the way with its HTML5
support. Not even Firefox supports as much as Opera does.
Thanks,
Ash
http://www.ashleysheridan.co.uk
Opera 10.10 is a very nice version, but 10.50 could be quite slow with
some web pages.
I still remember that once up
On Sat, 2010-04-03 at 17:03 +0200, dispy wrote:
> Am 03.04.2010 16:29, schrieb tedd:
> > Hi gang:
> >
> > Here's the problem.
> >
> > I have 184 HTML pages in a directory and each page contain a question.
> > The question is noted in the HTML DOM like so:
> >
> >
> > Who is Roger Rabbit?
> >
Why don't you just use REGEX? I don't know any possibility to easily
process contents which are not valid XML/XHTML just because there's no
library to load such stuff (but put me in right there).
I'm not an expert of REGEX, but I think the following would do it:
/\(.*)\<\/p\>
(my first contr
Hi
You could replace the "class" with "id" and then go on with JavaScript.
A possible better way are regular expressions...
Greetz
Piero
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Yes, and jquery is hosted on Microsoft CDN, do
On Sat, 2010-04-03 at 08:22 -0600, Peter Pei wrote:
> >>
> >
> >
> > Yes, because Opera is pretty much leading the way with its HTML5
> > support. Not even Firefox supports as much as Opera does.
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
>
> Opera 10.10 is a very nice ve
On Sat, 2010-04-03 at 20:51 +0530, vikash.i...@gmail.com wrote:
> If you are open to use javascript then a js library like jQuery may help in
> selecting all elements from a particular class.
>
> $(".clasName")
>
>
> Thanks,
> Vikash Kumar
> --
> http://vika.sh
>
>
> On Sat, Apr 3, 2010 at 8:
On 03.04.2010 17:17, Ashley Sheridan wrote:
> On Sat, 2010-04-03 at 17:03 +0200, dispy wrote:
>
>
>> Am 03.04.2010 16:29, schrieb tedd:
>>
>>> Hi gang:
>>>
>>> Here's the problem.
>>>
>>> I have 184 HTML pages in a directory and each page contain a question.
>>> The question is noted in the
I think Tedds main reason not to use Javascript is that he needs it to
be done on the server rather than the client machine.
ps. please use bottom posting on the list.
Thanks,
Ash
http://www.ashleysheridan.co.uk
But he also mentioned that he wanted to avoid copy and paste... it does
gi
On Sat, 03 Apr 2010 09:21:17 -0600, Ashley Sheridan
wrote:
s, first browser to have tabs, first to have that
odd homepage with thumbnails of y
Talking about Opera's 'speed dial"... I downloaded safari yesterday (which
I didn't like last time I used it), it now has the same kind of page bu
var_dump( array( true , 12 , "php already does this" ) );
array(3) {
[0]=> bool(true)
[1]=> int(12)
[2]=> string(21) "php already does this"
}
:)
Yeah. But this feature of PHP is a boon if used carefully and a curse if
careless. You can get AMAZING results if you're not caref
At 8:11 AM -0600 4/3/10, Peter Pei wrote:
On Sat, 03 Apr 2010 08:58:44 -0600, Ashley Sheridan
wrote:
On Sat, 2010-04-03 at 10:29 -0400, tedd wrote:
-snip-
Now, I can extract each question by using javascript --
document.getElementById("question").innerHTML;
Somejavascript engine alrea
On Sat, Apr 3, 2010 at 8:29 AM, tedd wrote:
> Hi gang:
>
> Here's the problem.
>
> I have 184 HTML pages in a directory and each page contain a question. The
> question is noted in the HTML DOM like so:
>
>
> Who is Roger Rabbit?
>
>
> My question is -- how can I extract the string "Who is Rog
At 3:58 PM +0100 4/3/10, Ashley Sheridan wrote:
I don't think there is a getElementsByClass function. HTML5 is
proposing one, but that will most likely be implemented in
Javascript before PHP Dom. There is a way to tidy up the HTML to
make it XHTML, but I'm not sure what it is. If you know roug
Somejavascript engine already support GetElementByClass, for example
Opera does.
My example shows how, namely:
document.getElementById("question").innerHTML;
will return the value within the class.
Cheers,
tedd
In your original post, you said the data you had was:
Who is Roger Rab
At 8:14 AM -0600 4/3/10, Peter Pei wrote:
No javascript's getElementByID() won't work here. As "question" is a
class, not an ID. But like what was mentioned here, you can use
getElementByClass() with Opera, and that will work.
Sort of.
Like I said, the folling will work:
document.getElementB
At 5:16 PM +0200 4/3/10, Piero Steinger wrote:
Hi
You could replace the "class" with "id" and then go on with JavaScript.
A possible better way are regular expressions...
Greetz
Piero
I can go with javascript "as-is" (what I showed) and don't have to
change any html.
Cheers,
tedd
--
--
At 4:22 PM +0100 4/3/10, Ashley Sheridan wrote:
I think Tedds main reason not to use Javascript is that he needs it
to be done on the server rather than the client machine.
ps. please use bottom posting on the list.
Thanks,
Ash
Yeah, one reason was to get this done in one operation and no
On Sat, Apr 3, 2010 at 10:18 AM, tedd wrote:
> At 8:14 AM -0600 4/3/10, Peter Pei wrote:
>
>> No javascript's getElementByID() won't work here. As "question" is a
>> class, not an ID. But like what was mentioned here, you can use
>> getElementByClass() with Opera, and that will work.
>>
>
> Sort
At 9:14 AM -0600 4/3/10, Peter Pei wrote:
Somejavascript engine already support GetElementByClass, for
example Opera does.
My example shows how, namely:
document.getElementById("question").innerHTML;
will return the value within the class.
Cheers,
tedd
In your original post, you said the
At 12:18 PM -0400 4/3/10, tedd wrote:
At 8:14 AM -0600 4/3/10, Peter Pei wrote:
No javascript's getElementByID() won't work here. As "question" is
a class, not an ID. But like what was mentioned here, you can use
getElementByClass() with Opera, and that will work.
Sort of.
Like I said, the f
Sort of.
Like I said, the folling will work:
document.getElementById("question").innerHTML;
While you are using a getElementById, which returns an ID, but adding
.innerHTML will return the class value.
Try it.
Cheers,
tedd
No, this will not work, if it appeared working, please re-chec
At 10:03 AM -0600 4/3/10, Nathan Nobbe wrote:
-snip- code
Your code worked like a charm.
Thanks.
Now, I can extract each question by using javascript --
document.getElementById("question").innerHTML;
tedd, are you slipping? i thought you were searching by the class
attribute, lol.
Yea
On Sat, 2010-04-03 at 09:33 -0600, Peter Pei wrote:
> > Sort of.
> >
> > Like I said, the folling will work:
> >
> > document.getElementById("question").innerHTML;
> >
> > While you are using a getElementById, which returns an ID, but adding
> > .innerHTML will return the class value.
> >
> > Tr
It might have worked in Internet Explorer, as for a while that browser
got confused over the class and id if two different elements on a page
had the same class and id values.
Thanks,
Ash
http://www.ashleysheridan.co.uk
IE and Opera were the two I tested with.
--
Using Opera's revolutionar
query("//p...@class='question']");
// here is where you extract the question sections of each file
foreach($oNodeList as $oDomNode)
var_dump($oDomNode->nodeValue);
should be trivial to expand that to work w/ multiple files.
Now, I can extract each question by using javascript --
document
Hi,
I have recently upgrade to 64 bit Intel i7 computer running Windows 7
Ultimate 64 bit.
I have setup PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit) with success.
phpinfo() shows the MySQL extension loaded, but when I try to use
mysql_connect( $host, $user, $password ) in a PHP script I get f
Peter Pei wrote:
>
>>>
>>> var_dump( array( true , 12 , "php already does this" ) );
>>>
>>> array(3) {
>>>[0]=> bool(true)
>>>[1]=> int(12)
>>>[2]=> string(21) "php already does this"
>>> }
>>>
>>> :)
>>>
>>
>> Yeah. But this feature of PHP is a boon if used carefully and a curse
>
On Sat, 03 Apr 2010 11:30:36 -0600, Nathan Rixham
wrote:
them in a google code project or suchlike.
They'll obviously never be as fast as Java/C but they do allow for
static typing of collections using primitive types
That will be wonderful.
--
Using Opera's revolutionary e-mail client: ht
Sumarliði Einar Daðason wrote:
I have setup PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit) with success.
phpinfo() shows the MySQL extension loaded, but when I try to use
mysql_connect( $host, $user, $password ) in a PHP script I get following
error:
PHP Warning: mysql_connect() [function.m
On 04/03/10 23:00, Nathan Rixham wrote:
Peter Pei wrote:
var_dump( array( true , 12 , "php already does this" ) );
array(3) {
[0]=> bool(true)
[1]=> int(12)
[2]=> string(21) "php already does this"
}
:)
Yeah. But this feature of PHP is a boon if used carefully and a cur
40 matches
Mail list logo