वेब कॅप्चर आणि रूपांतरित करण्यासाठी साधने

ग्रॅबझआयटीचे वेब स्क्रॅपर एपीपी वापरुन आपण स्क्रॅप कशा बदलू शकता?

वाढवा intGrabzIt च्या दरम्यान उदाहरण वेब भंगार आणि आपला अनुप्रयोग GrabzIt चा वापर करुन वेब स्क्रॅपर API प्रोग्राम करण्यासाठी वेब स्क्रॅपचे गुणधर्म बदलण्यासाठी.

वेब स्क्रॅपचे लक्ष्य बदला

खाली दिलेली उदाहरणे या दोन्हीमध्ये कसे बदल करायचे ते दर्शविते बियाणे URL आणि मुख्य लक्ष्य URL.

GrabzItScrapeClient client = new GrabzItScrapeClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
Target target = new Target();
//Set the target URL
target.URL = "http://www.example.com";
List<string> seedUrls = new List<string>();
seedUrls.Add("http://www.example.com/news.html");
seedUrls.Add("http://www.example.com/about.html");
seedUrls.Add("http://www.example.com/contactus.html");
//Set the seed URL's
target.SeedURLs = seedUrls.ToArray();
//Enter the id of the scrape you want to alter along with the target object
client.SetScrapeProperty("59421f049e3d991318d35e49", target);
$client = new GrabzItScrapeClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$target = new GrabzItTarget();
//Set the target URL
$target->SetURL("http://www.example.com");
$seedUrls = array();
$seedUrls[] = "http://www.example.com/news.html";
$seedUrls[] = "http://www.example.com/about.html";
$seedUrls[] = "http://www.example.com/contactus.html";
//Set the seed URL's
$target->SetSeedURLs($seedUrls);
//Enter the id of the scrape you want to alter along with the target object
$client->SetScrapeProperty("59421f049e3d991318d35e49", $target);
client = GrabzItScrapeClient.GrabzItScrapeClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
target = new GrabzItTarget.GrabzItTarget()
#Set the target URL
target.url = "http://www.example.com"
seedUrls = []
seedUrls.append("http://www.example.com/news.html")
seedUrls.append("http://www.example.com/about.html")
seedUrls.append("http://www.example.com/contactus.html")
#Set the seed URL's
target.seedURLs = seedUrls
#Enter the id of the scrape you want to alter along with the target object
client.SetScrapeProperty("59421f049e3d991318d35e49", target)

वेब स्क्रॅपमध्ये बदल करा

खाली दिलेल्या उदाहरणांत एक व्हेरिएबल सेट करा ते अ string नावांचा अ‍ॅरे, तथापि व्हेरिएबल इतर कोणत्याही प्रकारच्या साध्या डेटावर देखील सेट केला जाऊ शकतो.

GrabzItScrapeClient client = new GrabzItScrapeClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
Variable variable = new Variable("names");
List<string> names = new List<string>();
names.Add("Tom");
names.Add("Dick");
names.Add("Harry");
foreach(string name in names)
{
	variable.AddArrayItem(name);
}
//Enter the id of the scrape you want to alter along with the variable object
client.SetScrapeProperty("59421f049e3d991318d35e49", variable);
$client = new GrabzItScrapeClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$variable = new GrabzItVariable("names");
$names = array();
$names[] = "Tom";
$names[] = "Dick";
$names[] = "Harry";
$variable->SetValue($names);
//Enter the id of the scrape you want to alter along with the variable object
$client->SetScrapeProperty("59421f049e3d991318d35e49", $variable);
client = GrabzItScrapeClient.GrabzItScrapeClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
variable = new GrabzItVariable.GrabzItVariable("names")
names = []
names.append("Tom")
names.append("Dick")
names.append("Harry")
#Set the seed URL's
variable.value = names
#Enter the id of the scrape you want to alter along with the variable object
client.SetScrapeProperty("59421f049e3d991318d35e49", variable)

व्हेरिएबल व्हॅल्यू नंतर सामान्य मार्गाने वापरुन मिळवता येतो ग्लोबल.गेट खाली दर्शविल्याप्रमाणे पद्धत.

var names = Global.get("names");

नंतर स्क्रॅप सूचनांमध्ये अ‍ॅरे नावाचा वापर सामान्य म्हणून केला जाऊ शकतो.