Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP webscraper with javascript?
Old 12-06-2007, 06:30 PM PHP webscraper with javascript?
Novice Talker

Posts: 5
Name: Tony
Trades: 0
Hi,

I am not a programmer and just trying to understand some javascript.

I am using the javascript example below (link) to add html to a webpage:

http://www.dustindiaz.com/add-and-re...th-javascript/

No what I'm wondering is if I use that javascript example to add the word "Hi" to my webpage like this:

http://www.bazquirk.com/add_text_button.php

(By the way that page will just be a regular html page when I'm finished, it won't have the additional pho script on it).

So, the word "Hi" appears in the page. But would a PHP webscraper (one the retreives a specific word from html) be able to retreive that word if it is not part of the actual html?

Or would I need to somehow add updated pages via ftp to my server in order for the webscraper to work?

Is that word, "Hi" being added to the html, with the javascript I'm using?

Thanks for any help.

Tony
fusion38 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-06-2007, 08:13 PM Re: PHP webscraper with javascript?
NullPointer's Avatar
Will Code for Food

Posts: 2,784
Name: Matt
Location: Irvine, CA
Trades: 0
HTML and Javascript are both client side languages, so both you javascript and html should be retrievable.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 12-06-2007, 09:03 PM Re: PHP webscraper with javascript?
Novice Talker

Posts: 5
Name: Tony
Trades: 0
Thank you.

But what I'm wondering is what that javascript is really doing. When you click on the button and add the word "Hi" to the page, is that word "Hi" really being added to the html of the page?

When you click the button, and the word "Hi" is added, then view the source code, you don't see that word "Hi" in the html document. Does that mean the webscrapper won't see it?
fusion38 is offline
Reply With Quote
View Public Profile
 
Old 12-06-2007, 09:14 PM Re: PHP webscraper with javascript?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
is that word "Hi" really being added to the html of the page
No.

What javascript does, is to modify the DOM (Document Object Model) tree to apply your changes, but the source of the DOM, your HTML is __NOT__ modified.

What this means, is that any search engine, browser that don't interpret javascript or scrapper will only see the document at his state on load time.
No modification made via javascript will be taken in account.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 12-06-2007, 09:29 PM Re: PHP webscraper with javascript?
Novice Talker

Posts: 5
Name: Tony
Trades: 0
Thank you.

That's what I thought... Could you recommend an easy way to add a word to the html document by pressing a button?

I'm trying to figure out a way for my PHP webscraper script to be able to "see" a word or number that is added into the html document.

I thought maybe something like an automatic message posting script, however I want it to be invisible to the user who is pressing the button on my webpage.

(A user will press a button on my webpage which will add a new word or number to the html of my page, that new word is read by my PHP webscraping script.)

Thanks again.

Tony
fusion38 is offline
Reply With Quote
View Public Profile
 
Old 12-06-2007, 10:02 PM Re: PHP webscraper with javascript?
Novice Talker

Posts: 5
Name: Tony
Trades: 0
I guess the easiest thing to do could be just creating a javascript "POST" button that would post a word directly into the html of the webpage?

Thanks.
fusion38 is offline
Reply With Quote
View Public Profile
 
Old 12-08-2007, 05:23 PM Re: PHP webscraper with javascript?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
yep it would, provided you had some server side code set to catch the submission and write to the file.


javascript being a client side operation cannot write files on the server.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-08-2007, 05:56 PM Re: PHP webscraper with javascript?
Novice Talker

Posts: 5
Name: Tony
Trades: 0
Thanks.

Well I have a PHP script that is set up to "catch" the word that is posted.

Actually the PHP script is a "web scrapper" designed to retrieve a certain word.

Thanks again.
Tony
fusion38 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP webscraper with javascript?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26895 seconds with 12 queries