private static async Task <Object> getCompanyProfilePage(HtmlDocument htmlDocument) { CompanyProfile profile = new CompanyProfile(); profile.CompanyName = htmlDocument.DocumentNode.SelectSingleNode("//input[@type='hidden' and @name='VenName']").Attributes["value"].Value; profile.CompanyRegistrationNo = htmlDocument.DocumentNode.SelectSingleNode("//input[@type='hidden' and @name='VenComReg']").Attributes["value"].Value; profile.MailingAddress = htmlDocument.DocumentNode.SelectSingleNode("//textarea[@name='VenAdd']").InnerHtml; profile.Country = htmlDocument.DocumentNode.SelectSingleNode("//input[@name='VenCouCode']").Attributes["value"].Value; return(profile); }
public editCompanyProfile() { BindingContext = this; InitializeComponent(); //Sending HTTP request to obtain the company profile data Task <string> httpTask = Task.Run <string>(() => HttpRequestHandler.GetRequest("http://www2.sesco.com.my/etender/vendor/vendor_company_edit.jsp", true)); var httpResult = httpTask.Result.ToString(); //Extract company profile data from the response var profileData = Task.Run <Object>(() => DataExtraction.getWebData(httpResult, "userCompanyProfile")); //var profileData = DataExtraction.getWebData(httpResult, "userCompanyProfile"); CompanyProfile profile = (CompanyProfile)profileData.Result; companyName.Text = profile.CompanyName; companyRegistrationNo.Text = profile.CompanyRegistrationNo; mailingAddress.Text = profile.MailingAddress; country.Text = profile.Country; name = profile.CompanyName; regno = profile.CompanyRegistrationNo; coucode = profile.Country; }