ওয়েব ক্যাপচার এবং রূপান্তর করার সরঞ্জামসমূহ

গ্র্যাবজিট'র ওয়েব স্ক্র্যাপার এপিআই ব্যবহার করে আপনি কীভাবে কোনও স্ক্র্যাপ পরিবর্তন করতে পারেন?

বর্ধিত করা intGrabzIt এর মধ্যে উদাহরণ ওয়েব স্ক্র্যাপার এবং গ্র্যাবিজআইটি ব্যবহার করে আপনার অ্যাপ্লিকেশন ওয়েব স্ক্র্যাপার এপিআই প্রোগ্রামক্রমে ওয়েব স্ক্র্যাপগুলির বৈশিষ্ট্যগুলি পরিবর্তন করতে।

ওয়েব স্ক্র্যাপের লক্ষ্য পরিবর্তন করুন

নীচের উদাহরণে উভয়কে কীভাবে পরিবর্তন করা যায় তা দেখানো হয়েছে বীজ ইউআরএল এর এবং প্রধান লক্ষ্য 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)

পরিবর্তনশীল মানটি পরে ব্যবহার করে সাধারণ উপায়ে অ্যাক্সেস করা যায় Global.get নীচে প্রদর্শিত পদ্ধতি।

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

নামগুলি অ্যারে তখন স্ক্র্যাপের নির্দেশিকায় স্বাভাবিক হিসাবে ব্যবহার করা যেতে পারে।