utsavat 1 Posted February 9, 2013 Report Share Posted February 9, 2013 Hi all, lets take a simple example of a sitedafont.com now i want to make a bot that downloads all the new fonts till then end so how can i do that?Any hint or a slight guidance are most welcomed. Thanks in advance.Utsav Quote Link to post Share on other sites
odeesuba 24 Posted February 9, 2013 Report Share Posted February 9, 2013 define Startup { clear list(%Main Menu) navigate("http://www.dafont.com/", "Wait") wait for element(<class="dl">, 120, "Appear") comment("Build Main Menu") add list to list(%Main Menu, $scrape attribute(<outerhtml=w"<a href=\"./alpha.php?lettre=*\"> *</a>">, "fullhref"), "Don\'t Delete", "Global") } define Go To Main Page { navigate($list item(%Main Menu, 0), "Wait") wait for browser event("Everything Loaded", "") wait for element(<class="dl">, 120, "Appear") if($comparison($scrape attribute(<name="fpp">, "value"), "!=", 50)) { then { change dropdown(<name="fpp">, 50) click(<value="Submit">, "Left Click", "No") wait for browser event("Page Loaded", 120) } else { } } set(#Temp URL, $url, "Global") } define Go To Sub Page { loop while($exists(<src="/img/page_suivante.gif">)) { click(<src="/img/page_suivante.gif">, "Left Click", "No") wait(10) wait for browser event("Page Loaded", 120) if($exists(<src="/img/theme_suivant.gif">)) { then { } else { wait for element(<src="/img/page_suivante.gif">, 120, "Appear") } } set(#Temp URL, $url, "Global") Download From Page() navigate(#Temp URL, "Wait") } } define Download From Page { clear list(%URL) add list to list(%URL, $scrape attribute(<class="dl">, "href"), "Don\'t Delete", "Global") loop while($comparison($list total(%URL), ">", 0)) { download file($list item(%URL, 0), "{$special folder("Desktop")}\\fonts\\{$find regular expression($list item(%URL, 0), "(?<=f\\=).*")}.zip") remove from list(%URL, 0) } } Startup() loop while($comparison($list total(%Main Menu), ">", 0)) { Go To Main Page() Download From Page() comment("Work Around For Freez") navigate(#Temp URL, "Wait") Go To Sub Page() remove from list(%Main Menu, 0) } This bot will go through all the main pages, and then the sub pages and download all fonts on every page. This will take a lot or resources from the site, so be gentle or they may ban your ip. dafont.ubot 1 Quote Link to post Share on other sites
utsavat 1 Posted February 9, 2013 Author Report Share Posted February 9, 2013 Thanks a lot Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.