Vhaerun Posted February 24, 2008 Report Share Posted February 24, 2008 Salut !Spre deosebire de tutorialul AutoIT , unde am vazut un "bot" care automatiza Internet Explorer , azi va arat acelasi bot facut in perl . Daca ati rulat bot-ul AutoIT , ati vazut cu siguranta ca se misca destul de incet . Ei bine , un bot in perl e mult mai rapid , consuma doar cativa kilo de memorie ( spre deosebire de multi mega cat consuma Internet Explorer ) , si , dupa parerea mea e mult mai usor de facut debugging asupra lui .use strict; # folosirea acestui modul obliga declararea variabileloruse warnings; # folosirea acestui modul genereaza avertizariuse WWW::Mechanize; # modulul Mechanize , reprezentarea unui browsermy $user=shift || die "Username\n"; # cere usermy $pass=shift || die "parola\n"; # cere parolamy $mech=WWW::Mechanize->new(); # se creeaza mech-ul$mech->agent_alias("Windows IE 6"); # mimam Internet Explorer$mech->get("http://rstcenter.com/forum/"); # vizitam forumul$mech->form_number(1); # alegem primul form$mech->field("username",$user); # completam campul user$mech->field("password",$pass); # si pass$mech->click(); # realizeaza logarea#urmatoarele linii sunt optionale ,ele creeaza un fisier html#cu continutul paginii curente a mech-ului#dupa deschiderea paginii , se va vedea ca mech-ul a reusit logareaopen(F,">temp.html") || die "Nu pot creea $!\n";print F $mech->content();close(F); Quote Link to comment Share on other sites More sharing options...
Vhaerun Posted February 24, 2008 Author Report Share Posted February 24, 2008 Si un cod care sa se logheze pe Bitefight , pentru ca multa lume mi-a cerut . ATENTIE : eu folosesc server 2 ! use strict;use warnings;use WWW::Mechanize;my $user=shift || die "User\n";my $pass=shift || die "parola\n";my $mech=WWW::Mechanize->new();$mech->agent_alias("Windows IE 6");$mech->get("http://s2.bitefight.ro/bite/login.php");$mech->form_number(1);$mech->field("user",$user);$mech->field("pass",$pass);$mech->click();sleep(2); # astept 2 secunde inainte sa cer URL-ul urmator# merg la pagina principala$mech->get("http://s2.bitefight.ro/bite/uebersicht.php?&web_redirected=1");# fac un fisier html pentru a vedea mai usor sursa paginii curenteopen(F,">tempbite.html") || die "nu pot creea $!\n";#scriu sursa paginiiprint F $mech->content();#inchid fisierulclose F;You kids have fun ! Quote Link to comment Share on other sites More sharing options...
kw3rln Posted February 24, 2008 Report Share Posted February 24, 2008 interesant .. "WWW::Mechanize" dar parca prefer "LWP::UserAgent" & "HTTP::Request::Common" Quote Link to comment Share on other sites More sharing options...
Vhaerun Posted February 24, 2008 Author Report Share Posted February 24, 2008 Mechanize se bazeaza pe LWP , dar mi se pare mai usor de folosit . Quote Link to comment Share on other sites More sharing options...
Vhaerun Posted February 25, 2008 Author Report Share Posted February 25, 2008 AICI se poate downloada un tutorial video facut de mine , care va arata cum sa gasiti numele campurilor ce urmeaza a fi completate . Obligatoriu de vazut , daca nu ai experienta in domeniu Quote Link to comment Share on other sites More sharing options...
moubik Posted February 25, 2008 Report Share Posted February 25, 2008 nice Quote Link to comment Share on other sites More sharing options...
yoyo2008 Posted February 25, 2008 Report Share Posted February 25, 2008 de ce nu merge firebug?de la windows?de ce am mozila in lb romana?de la antivirus? Quote Link to comment Share on other sites More sharing options...
Vhaerun Posted February 25, 2008 Author Report Share Posted February 25, 2008 Chestie foarte ciudata : avi-ul are vreo 90 de mega si arhiva doar 4 !!!Se pare ca nu toate playerele pot sa deschida filmul . Se vede la voi ? Quote Link to comment Share on other sites More sharing options...
yoyo2008 Posted February 25, 2008 Report Share Posted February 25, 2008 la mine se vede foarte bine doar ca nu merge firebug Quote Link to comment Share on other sites More sharing options...
moubik Posted February 25, 2008 Report Share Posted February 25, 2008 Chestie foarte ciudata : avi-ul are vreo 90 de mega si arhiva doar 4 !!!Se pare ca nu toate playerele pot sa deschida filmul . Se vede la voi ?Vhaerun, avi-ul are 90mb pentru ca nu este compresat. de aceea arhiva are 4mb.nu stiti cum se face encodarea video ? Quote Link to comment Share on other sites More sharing options...
yoyo2008 Posted February 25, 2008 Report Share Posted February 25, 2008 Vhaerun de ce nu-mi merge firebug-ul?pt ce encodarea moubik? Quote Link to comment Share on other sites More sharing options...
Vhaerun Posted February 25, 2008 Author Report Share Posted February 25, 2008 @moubikNu sunt interesat de encoding , formate audio/video . Poate vreodata daca o sa am nevoie , o sa invat , momentan consider ca mi-as incarca memoria inutil.@yoyo2008Ce versiune de Firefox ai ? Se incadreaza intre cele recomandate de firebug ? Quote Link to comment Share on other sites More sharing options...
yoyo2008 Posted February 25, 2008 Report Share Posted February 25, 2008 am versiunea 2.0.0.12 Quote Link to comment Share on other sites More sharing options...
Vhaerun Posted February 25, 2008 Author Report Share Posted February 25, 2008 Ciudat , pe site scrie ca e suportata . Incearca sa reinstalezi firebug , si daca nu merge nici asa , incearca sa reinstalezi firefox . Are altcineva alte sugestii ? O sa mai postez niste metode alternative la firebug , just in case . Quote Link to comment Share on other sites More sharing options...
yoyo2008 Posted February 25, 2008 Report Share Posted February 25, 2008 am rezolvat e din cauza asta Firebug crashes immediately when I try to open it.The most likely cause for this is the Sothink SWF Catcher extension. If you have this extension installed, disabling it will allow Firebug to work properly. Quote Link to comment Share on other sites More sharing options...
Vhaerun Posted February 25, 2008 Author Report Share Posted February 25, 2008 Uitati aici inca doua alternative la firebug :1. Tamper data , cu tutorial video AICI2. Odata cu instalarea WWW::Mechanize , vine si un script numit mech-dump,cu care pot fi gasite form-uri , precum si alte elemente dintr-o pagina. mech-dump se ruleaza astfel ( modul default de functionare arata form-urile ) :mech-dump site Quote Link to comment Share on other sites More sharing options...
moubik Posted February 26, 2008 Report Share Posted February 26, 2008 vhaerun, modulul Mechanize am vazut ca nu este in lista pachetelor pentru windows.adica nu pot sa-l instalez cu 'ppm'l-am instalat manual.ca alta intrebare.stie cineva cum pot sa rulez o comanda de sistem dar sa nu se opreasca exacutia programului acolo ?adica sa pot sa omor acea comanda daca vreau, cand vreau. Quote Link to comment Share on other sites More sharing options...
Vhaerun Posted February 26, 2008 Author Report Share Posted February 26, 2008 fork ? thread ? Quote Link to comment Share on other sites More sharing options...
moubik Posted February 26, 2008 Report Share Posted February 26, 2008 da, thread. am implementat deja. Quote Link to comment Share on other sites More sharing options...
inthel Posted April 21, 2008 Report Share Posted April 21, 2008 baieti ... imi ziceti si mie o functie pentru timp?vreau sa determin timpul mai exact as vrea un prog care sa faca anumite pauze intre actiunile luimultumesc anticipat Quote Link to comment Share on other sites More sharing options...
Vhaerun Posted April 21, 2008 Author Report Share Posted April 21, 2008 sleep ?cam asta am inteles eu din mesajul tau . Quote Link to comment Share on other sites More sharing options...
inthel Posted April 21, 2008 Report Share Posted April 21, 2008 nu.deci vreau ca programul sa execute o actiune(de ex sa deschida o pagina)apoi sa i-a o pauza(adica sa nu faca nimic 5 min) si dupa aceea sa faca o alta actiune (de ex sa navigheze spre o pagina).asta nu e greu dar nu stiu eu o functie ceva cu care sa determin timpulapropo ... ai putea sa-mi recomanzi un tutorial autoit(sau ceva apropiat) care sa fie explicit si mai complex (chiar si in engleza) Quote Link to comment Share on other sites More sharing options...
Vhaerun Posted April 21, 2008 Author Report Share Posted April 21, 2008 si ce anume te-a facut sa zici nu la functia sleep ? stii ce face ? #!/usr/bin/perlfa_ceva();sleep(5 * 60); # in limbaj pt muritori , 5 minute nu fa nimicfa_altceva(); Quote Link to comment Share on other sites More sharing options...
inthel Posted April 21, 2008 Report Share Posted April 21, 2008 sincer : nude aia ti-am cerut si tutoriale oricum ms mult Quote Link to comment Share on other sites More sharing options...
F1d Posted April 30, 2008 Report Share Posted April 30, 2008 am incercat si eu sa rulez scriptul : am instalat perl dar cand il rulez primesc eroarea : Can't locate WWW/Mechanize.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at Untitled1 line 4.BEGIN failed--compilation aborted at Untitled1 line 4.am cautat pe Google mechanize am gasit niste fisiere dar nu m-am prea descurcat .... :oops: ar putea cineva sa ma ajute cu Mechanize ( download + instalare ) ? Quote Link to comment Share on other sites More sharing options...