Skip to content

Commit 5e0e923

Browse files
authored
Merge pull request #55 from CodeSandwich/fix_selenium_test
Fix start URL with JS test
2 parents 1810c84 + 31c5427 commit 5e0e923

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

scraper/src/tests/config_loader/open_selenium_browser_test.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,14 @@ def test_browser_needed_when_config_contains_automatic_tag(self,
3939
c = config({
4040
"start_urls": [
4141
{
42-
"url": "https://symfony.com/doc/(?P<version>.*?)/(?P<type_of_content>.*?)/",
42+
"url": "https://example.com/(?P<var1>.*?)/(?P<var2>.*?)/",
4343
"variables": {
44-
"version": {
45-
"url": "https://symfony.com/doc/current/book/controller.html",
46-
"js": """\
47-
var versions = $('.doc-switcher .versions li').map(function (i, elt) {\
48-
return $(elt).find('a').html().split('/')[0].replace(/ |\\n/g,'');\
49-
}).toArray();\
50-
versions.push('current');\
51-
return JSON.stringify(versions);"""
44+
"var1": {
45+
"url": "https://example.com",
46+
"js": "return JSON.stringify(\
47+
document.getElementsByTagName('h1')[0].textContent.split(' '))"
5248
},
53-
"type_of_content": ["book", "bundles", "reference",
54-
"components", "cookbook",
55-
"best_practices"]
49+
"var2": ["one", "two", "three"]
5650
}
5751
}
5852
]

0 commit comments

Comments
 (0)