Created
June 3, 2019 12:18
-
-
Save gunaevart/96deb826b55cfac96aa982f3911484f5 to your computer and use it in GitHub Desktop.
Код парсера для C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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