Skip to content

Commit

Permalink
fixed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedWalid1 committed Jun 4, 2021
1 parent f29da9c commit 5298022
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/com/company/Crawler/Crawler.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void parse(String args) throws IOException {
//Document doc = Jsoup.parseBodyFragment(website);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
LocalDateTime time = LocalDateTime.now();
database.AddVisited(website,doc,dtf.format(time));
database.AddVisited(website,dtf.format(time));
f1.write(website + '\n');
//System.out.println(doc);
Elements links = doc.select("a[href]");
Expand Down
6 changes: 2 additions & 4 deletions src/com/company/Crawler/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Database() {
websites.createIndex("indexed");
websites.createIndex("rank");
//websites.createIndex("hyberlinks");
websites.createIndex("HTMLDocuments");
//websites.createIndex("HTMLDocuments");
websites.createIndex("Time");
disallowedWebsite=crawlerDatabase.getCollection("DisallowedWebsites");
//hyberlinks = crawlerDatabase.getCollection("hyberlinks");
Expand All @@ -61,13 +61,12 @@ public Database() {

}

public void AddVisited(String website, org.jsoup.nodes.Document doc, String time){
public void AddVisited(String website, String time){

BasicDBObject row = new BasicDBObject("URL", website)
.append("crawled", 1)
.append("indexed", 0)
.append("rank",(double) 0.0)
.append("HTMLDocuments",doc)
.append("Time",time);

websites.insert(row);
Expand All @@ -79,7 +78,6 @@ public void AddHyberlinks(String website, String time){
.append("crawled", 0)
.append("indexed", 0)
.append("rank",(double) 0.0)
.append("HTMLDocuments",(Document)null)
.append("Time",time);

websites.insert(row);
Expand Down
Binary file modified target/classes/com/company/Crawler/Crawler.class
Binary file not shown.
Binary file modified target/classes/com/company/Crawler/Database.class
Binary file not shown.

0 comments on commit 5298022

Please sign in to comment.