Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gunaevart/96deb826b55cfac96aa982f3911484f5 to your computer and use it in GitHub Desktop.
Save gunaevart/96deb826b55cfac96aa982f3911484f5 to your computer and use it in GitHub Desktop.
Код парсера для C#
using CsQuery; // подключаем и качаем
// https://github.com/jamietre/CsQuery/blob/master/distribution/CsQuery.dll
string val = textBox2.Text; // 1-параметр запроса
string val2 = textBox1.Text; // 2-параметр запроса
var web = CQ.CreateFromUrl($"https://www.avito.ru/rossiya?s_trg=3&q={val}+{val2}");
var data = web.Select(".data"); //проходим по всем классам "data"
var about = web.Select(".about"); //проходим по всем классам "about"
if (data != null)
{
foreach (var k in data)
{
listBox1.Items.Add(k.InnerText.ToString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment