I have written a script to to extract certain information from a site, the code runs fine but its awfully slow (i have compiled the function and enabled JIT), how can I check if the delay is due to web page traffic ? Any help would be appreciated
url = "http://www.currys.co.uk/gbuk/computing-accessories/accessories-and-bags/power- cables/power-cables-adaptors/masterplug-bfg2-mp-4-gang-extension-cable-2m-00852134-pdt.html? srcid=369&xtor=AL-1&cmpid=aff~!!!sitenamecm!!!~!!!promotypecm!!!~Computing+Accessorie"
getpagedata = function (url, uniq_id)
{
srcpage = getURLContent(parenturl)
page = htmlTreeParse(srcpage,useInternalNodes = T,encoding='UTF-8')
link = '0'
availability = xpathSApply(page, "//span[@class ='available']",xmlValue)
if (length(availability) > 0 )
{
if (length(availability_option) > 0)
{
availability_option = paste0(toString(str_replace_all(availability_option,"\n|\t","")),",")
}
availability = paste0("'",availability_option,toString(str_replace_all (availability,"\n|\t","")),"'")
}
df2 = data.frame(starttime,Sys.time(),store,uniq_id,Avail_Flag,availability,link)
writetofile_c(df2)
free(page)
}
Thanks,