Skip to content

Commit

Permalink
get fields init education scrap
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoSantosGit committed Sep 5, 2018
1 parent 8b6a2a5 commit 9e9a301
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,28 @@ public Result<WorkIncome> GetWorkIncome(string html)
public Result<Education> GetEducation(string html)
{
var blockPop = _scrapParser
.ScrapBlockPage(html, "colspan=\"2\">População</th>", "colspan=\"2\">Educação</th>");
.ScrapBlockPage(html, "colspan=\"2\">Educação</th>", "colspan=\"2\">Economia</th>");

var tablesEdu = blockPop.SplitString("<tr _ngcontent-c2017=");

var education = new Education();

try
{

if (!string.IsNullOrEmpty(tablesEdu[1]?.ToString()))
education.SchoolingRate = _scrapParser
.ScrapBlockPage(tablesEdu[1], "class=\"lista__valor\" colspan=\"2\">",
"<span _ngcontent")?.Trim();

if (!string.IsNullOrEmpty(tablesEdu[3]?.ToString()))
education.EarlyYearSchool = _scrapParser
.ScrapBlockPage(tablesEdu[3], "class=\"lista__valor\" colspan=\"2\">",
"<span _ngcontent")?.Trim();

if (!string.IsNullOrEmpty(tablesEdu[5]?.ToString()))
education.FinalYearSchool = _scrapParser
.ScrapBlockPage(tablesEdu[5], "class=\"lista__valor\" colspan=\"2\">",
"<span _ngcontent")?.Trim();
}
catch (Exception ex)
{
Expand Down

0 comments on commit 9e9a301

Please sign in to comment.