Crawling AJAX in practice. Part 1

Some theory

Traditionally, a web spider system is tasked with connecting to a server, pulling down the HTML document, scanning the document for anchor links to other HTTP URLs and repeating the same process on all of the discovered URLs. Each URL represents a different state of the traditional web site. In an AJAX application, much of the page content isn't contained in the HTML document, but is dynamically inserted by Javascript during page load. Furthermore, anchor links can trigger Javascript events instead of pointing to other documents. The state of the application is defined by the series of Javascript events that were triggered after page load. The result is that the traditional spider is only able to see a small fraction of the site's content and is unable to index any of the application's state information.

Some findings

I've googled around for a few days and have found various information about crawling tools. There are more, but some are forgotten to mention or haven't been tried. Here is a quick summary of tools for getting page source.

1) Right click, View page source. Well, a simple way to get page source, but you fall laughing when you see the dynamic page source. I was playing around with ubs.com -> quotes -> instruments.
2) Perl::Mechanize. It's a useful tool, i was happy using it, but the result is sadly though - static. It fills forms and follows links, but the final page source is static. It digs text, digs .css underneath, but avoids JavaScript. You can get a page source browsing only static version of webpage (which ubs.com has). This tools is useful for sabotage, for example you create disposable email accounts, vote online for a car of the year, read the passkey from you temp email, vote and repeat the loop again. No user interface needed, while testing use browser and
compare it to Mechanize agent->content.
3) Various Firefox extensions. Crap, the target was to build a GUI-less mechanism, these implementations though require user interaction. Extensions are based on tracking AJAX requests, recording user actions (like macros in Office). iMacros, ChickenFoot, Selenium. Here are the names. iMacros are error sensitive, for example first visit and getting a cookie differs from the subsequent visits. Mechanize for example is error proof for such actions. I haven't found use of other extensions, because most of them doesn't work on Minefield, nor RedHat's Firefox one point zero something.
4) Ruby + Watir. AJAX crawling after all! But there is a huge "but" - presenting IE. There are also Watir implementations on FF and Safari, haven't tested them. Ruby is also error proof, and i have achieved some progress, but the result is STATIC. Spent half a day looking for a way to save page content to file, spent one day more for looking how to get a full page source, but didn't manage that. Please inform me if i'm wrong, but anyways - skype has an emotion for coding on windows: (puke).
5) Yes you are right, saved the best for dessert. XULRunner + Crowbar. This stuff works and rocks and has an implementation, more about it in Part 2. Here is a quote: "...a server-side headless mozilla-based browser". It even sounds promising. It runs as a daemon, you can ask it, push it, get contents, and get AJAXed source. Its a browser based execution environment with a scraping tool on it. After you get your desired page source, its kinda trash: no newlines, bunch of HTML tags. Then there are few solutions - pass it to Lynx or process manually with a custom C code parser. At last we have the numbers, not a JavaScript function names.

Clarification

The purpose of this task is not to exactly crawl from one page to other, its only numbers that are pushed (AJAX'ed) via JavaScript that matters.

Part 2

turinio valdymo sistema (tvs) leidžia patiems redaguoti svetainės turinį, visos funkcijos greitos ir paprastos net mažai įgudusiam vartotojui. pagaminu, sukonfigūruoju, suprojektuoju visą sistemą, užpildau pradiniu turiniu.

modulinė tvs komplektuojama (bet neapsiriboja) iš šių modulių:
- naujienos / blogas
- puslapiai (su ir be komentarų)
- forumas
- automatiniai nuotraukų įrankiai
- krepšelis prekėms (e-parduotuvė)
- seo (standartinis modulis)
- galerijos
- skaidrės
- daugelio kalbų palaikymas
- paypal, paysera (e-parduotuvei)

internetinė aplikacija tai duomenų baze paremta sistema, kurios valdymas atliekamas per naršyklę. tokio tipo aplikacijos nereikalauja jokių papildomų priedų, konfigūracijos, jos yra centralizuotai keičiamos, taisomos, atnaujinamos. mūsų kuriamų aplikacijų pagrindas yra oracle duomenų bazė, ko pasekoje mes galima pasiūlyti galingas, lanksčias, norimo sudėtingumo lygio aplikacijas.

internetinė aplikacijos gali būti pritaikomos šiems sprendimams:
- apskaitos įrankiai (finansų, laiko, prekių, formos)
- internetinė parduotuvė
- interneto portalas
- duomenų surinkimo terminalas

parduotuvės galimybės:
- prekių katalogas
- sandėlis (prekių kiekių apskaita)
- užsakymų valdymas (rankinis pateikimas, vartotojų užsakymų vykdymas ir sekimas)
- nuolaidų katalogas
- atsiskaitymai paypal ir paysera (mokėjimai.lt)

atliekame serverio pradinį paruošimą, aptarnavimą ir monitoringą. konsultuojame serverio įsigijimo klausimais, padedame specifikuoti ir išsirinkti. specializuojamės linux, unix, windows sistemose.

linux redhat/centos/unbreakable/suse
- konfigūravimas
- pradinis diegimas
- soft raid
- monitoringas
- apsauga
- disko kodavimas

elektroninio pašto siuntimo funkcija visiems yra gerai žinoma, daugelis naudojasi interneto tiekėjų paslaugomis. siūlome sprendimą skirtą tiems, kurie nori būti tikri dėl visapusiško savo duomenų privatumo. serveris diegiamas kliento prieigoje arba pasirinktame nuomojamame serveryje. jame talpinamas e-pašto turinys, registras, papildomos apsaugos ar funkcijos:
- antivirusinė apsauga
- brukalo (spam) filtras ir automatizuotas valdymas (naikinti, grąžinti, kaupti vienoje dėžutėje)
- neribotas dėžučių skaičius
- prieinamumas visais žinomais protokolais: pop3, imap, www
- dinaminė ugniasienė
- kiti mechanizmai: postgrey, rbl

Mes kuriame internetines svetaines, elektronines parduotuves, intraneto aplikacijas. Taip pat prižiūrime serverius, juos diegiame. Galime įdiegti papildomus serverio servisus kaip e-pašto funkcija ar statistikos rinkimas.
Internetinės svetainės kuriamos naudojant modulinę turinio valdymo sistemą, Jums sukomplektuojamos reikalingos funkcijos. Svetainė yra automatiškai SEO optimizuota paieškoms ir nereikalauja jokios rankinės priežiūros. Jeigu reikia galima užpildyti ir turinį.
Įmonių aplikacijų pavyzdžiai: CRM, sandėlio valdymas, sąskaitų generavimas, laiko apskaita, intranetas, forumas, registracijos forma, klientų atsiliepimų ar problemų registravimo sistema. Galime suprogramuoti bet kokią jums reikalingą sistemą.