Description: C# I got this url: http://restaurantkoed.dk/en/menu/ From this webs
ID: 3607056 • Letter: D
Question
Description: C#
I got this url: http://restaurantkoed.dk/en/menu/
From this website, i would like to grab the (DESSERTS) (has to be done by code)
and insert them into my class
___________________________________________
I got a class
Class Food
{
public string Name {get; set;}
public int price{get;set;}
}
________________________________
My problem is that i am not used to using the HtmlAgilityPack
Little bit of code i have done:
string url = "http://restaurantkoed.dk/en/menu/";
var webSite = new HtmlWeb();
var doc = webSite.Load(url);
var Node = doc.DocumentNode.SelectNodes("/html/body/main/article/div/div/div/section[9]/div[3]/div/div[2]/div/div");
if (Node != null)
{
????
}
else Console.WriteLine("No data");
Explanation / Answer
#include <iostream>
using namespace std;
int main()
{
char c;
int isLowercaseVowel, isUppercaseVowel;
cout << "Enter an alphabet: ";
cin >> c;
// evaluates to 1 (true) if c is a lowercase vowel
isLowercaseVowel = (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
// evaluates to 1 (true) if c is an uppercase vowel
isUppercaseVowel = (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U');
// evaluates to 1 (true) if either isLowercaseVowel or isUppercaseVowel is true
if (isLowercaseVowel || isUppercaseVowel)
cout << c << " is a vowel.";
else
cout << c << " is a consonant.";
return 0;
}