«« Next » « Previous
«« Next » « Previous

Link Details

If you were logged in, then you could vote. Don't wait. Login and vote now.
Link 40525 thumbnail

By bloid
via blogs.pathf.com
Published: Sep 10 2007 / 18:41

Yes, yes, innerHTML is "the debil." Direct DOM manipulation is much to be preferred. It's faster, smells less, and gives you shiny white teeth. But innerHTML, when combined with XHR, can allow you to scrape data from the existing HTML pages of a site.
  • 12
  • 2
  • 1169
  • 422

Comments

Add your comment
User 238564 avatar

FlySwat replied ago:

1 votes Vote down Vote up Reply

Wouldn't the XMLHTTPRequest be denied as cross site scripting?

I've used a similiar technique in a project of mine, and it only worked for pulling pages directly from the callers domain. As it should.

User 200731 avatar

dkappe replied ago:

0 votes Vote down Vote up Reply

That's correct. You would use it to pull HTML from the current domain. As the article explains, you would use this in only certain circumstances, such as when you can't get the backend system to generate XML.

User 238564 avatar

FlySwat replied ago:

0 votes Vote down Vote up Reply

Screen Scraping would be of rather limited use if you already have access to the domain.

User 200731 avatar

dkappe replied ago:

0 votes Vote down Vote up Reply

Ah, FlySwat. Stay tuned for some of the interesting things you can do with screen scraping and bookmarklets.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (12)



Voters Against This Link (2)