Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for NUTCH-2460 contributed by Hussein Alahmad #245

Closed
wants to merge 2 commits into from

Conversation

hussein-alahmad
Copy link
Contributor

use the headless option of firefox and chrome in protocol-selenium

the --headless option is added to firefox in version 55 or later , and in chrome in version 59 or later ...
this is much better than relying on xvfb and its associates .
we can add it as a property in the config file .
I'm trying it on my local machine , and will create a pull request when I finish testing it

I've tested it using firefox 57.0 , gecodriver 0.19.1 and selenium 3.7.1

Important note : you need to add the following property to nutch-default.xml or nutch-site.xml for the headless option to work

selenium.firefox.headless true A Boolean value representing if firefox should run headless . make sure that firefox version is 55 or later, and selenium webDriver version is 3.6.0 or later. The default value is false. Currently this option exist for - 'firefox'

Copy link
Member

@lewismc lewismc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hussein-alahmad can you also provide the nutch-default.xml options ?

@@ -166,7 +175,7 @@ public static String getHTMLContent(WebDriver driver, Configuration conf) {
public static void cleanUpDriver(WebDriver driver) {
if (driver != null) {
try {
driver.close();
// driver.close();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hussein-alahmad Why is this commented?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a driver.quit() statement after it , I was getting an error about trying to close a non existing connection , after searching about it , turned out that driver.quit() alone without the driver.close() do the work
as mentioned here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @hussein-alahmad

@hussein-alahmad
Copy link
Contributor Author

hussein-alahmad commented Jan 3, 2018

<property> <name>selenium.firefox.headless</name> <value>false</value> <description>A Boolean value representing if firefox should run headless . make sure that firefox version is 55 or later, and selenium webDriver version is 3.6.0 or later. The default value is false. Currently this option exist for - 'firefox' </description> </property>

@lewismc
since all the conf files are ignored , should I force it ?

Copy link
Member

@lewismc lewismc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hussein-alahmad i think including the compatible version of Firefox within the documentation would be wise.

@lewismc
Copy link
Member

lewismc commented Jan 18, 2018

@hussein-alahmad ping

@hussein-alahmad
Copy link
Contributor Author

@lewismc very very sorry for the late reply
I added the property to nutch-default.xml , and updated the documentation

@sbatururimi
Copy link
Contributor

Any plan to merge that?

@sebastian-nagel
Copy link
Contributor

The corresponding issue NUTCH-2460 is now marked for 1.16, so it will get reviewed. Thanks, @sbatururimi for the reminder.

@sbatururimi
Copy link
Contributor

I'm adding more features in NUTCH-2676 also.

@sebastian-nagel
Copy link
Contributor

Thanks, @sbatururimi! Let us know whether it still makes sense to merge this PR. Afaics, the requested changes are made and the merge conflicts are easy to resolve.

@sbatururimi
Copy link
Contributor

Maybe it will make sense to wait till the mid/end of the next week in order to compare how much have been added :).

@sebastian-nagel
Copy link
Contributor

Included in #430 / dfd8602. Thanks, @hussein-alahmad and @sbatururimi!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants