Commits

Frederic De Groef committed c530ace

[lalibre] extract_article_data() supports url and file-like objects

Comments (0)

Files changed (1)

csxj/datasources/lalibre.py

 
 
 
-def extract_article_data(source_url):
+def extract_article_data(source):
     """
     """
+    if hasattr(source, 'read'):
+        html_content = source.read()
+    else:
+        html_content = fetch_html_content(source)
 
-    html_content = fetch_html_content(source_url)
-    return extract_article_data_from_html(html_content, source_url)
+    return extract_article_data_from_html(html_content, source)