sawantuday / crawler4j

Automatically exported from code.google.com/p/crawler4j
0 stars 0 forks source link

putting Selenium Code into CrawlController --> Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE #265

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I´m using Eclipse and Java for configuring my Crawler (Crawler4j)
- Crawler4j works alone as I wish and crawls my Sites properly.
- Selenium in own main class works as I wish and opens Firefox.

What steps will reproduce the problem?
1.Putting WebDriver driver = new FirefoxDriver(); into my CrawlController (into 
the main())
2.Putting WebDriver driver = new FirefoxDriver(); into  public void visit(Page 
page) {.....} of my public class MyCrawler extends WebCrawler {...}

What is the expected output? What do you see instead?
The Crawler should get information like Id´s of the page and handle them to 
Selenium for testing.

What version of the product are you using?
- Crawler4j 3.5 jar
- Selenium-java-2.42.jar

Please provide any additional information below.
Here the Exception I get when putting the Selenium code with the 
CrawlController:
Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE
    at org.apache.http.impl.conn.HttpClientConnectionOperator.<init>(HttpClientConnectionOperator.java:75)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:149)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:136)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:112)
    at org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:68)
    at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:55)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:99)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:82)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:93)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:115)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:95)
    at automated_XSS_detection.com.MyCrawlController.main(MyCrawlController.java:23)

Original issue reported on code.google.com by ju...@gmx.net on 11 Jun 2014 at 3:25

GoogleCodeExporter commented 9 years ago
I don't think it works like you think. the webcrawler doesn't run in a browser 
like you are telling selenium to do. You can try creating the selenium instance 
where you start crawlers. then pass that to the crawl process that contains 
visit(Page page) method.

What are you trying to do exactly? 

Original comment by jeger...@gmail.com on 17 Jun 2014 at 1:56

GoogleCodeExporter commented 9 years ago
Hi, it works now it was just an old httpclient.jar and httpcore.jar that causes 
that issue. I can crawl the site get the Source by the crawler then parse the 
source and then pass it to selenium to work further.

Original comment by ju...@gmx.net on 11 Jul 2014 at 9:53

GoogleCodeExporter commented 9 years ago
Not a bug or feature thus moved to the forum

Original comment by avrah...@gmail.com on 17 Aug 2014 at 5:58