Giter Site home page Giter Site logo

Comments (6)

keepcosmos avatar keepcosmos commented on May 25, 2024

Can you give me your example site url or html document?

from readability.

rupertqin avatar rupertqin commented on May 25, 2024

@keepcosmos for example https://www.douban.com/note/603462275/

from readability.

JosephHalter avatar JosephHalter commented on May 25, 2024

Also crashes with the same error on many english pages, for example any article I tried from The New York Times https://www.nytimes.com/2017/01/30/us/immigration-ban-locations.html?_r=0

from readability.

keepcosmos avatar keepcosmos commented on May 25, 2024

@rupertqin Thanks for reporting. It fixed. Try v 0.7.0

@JosephHalter Your error also fixed. But it was different case. Your url return 303. Maybe it is httpoison issue. Plz check here

from readability.

rupertqin avatar rupertqin commented on May 25, 2024

v0.8.0

In most case, Readability.summarize is always work, but in my case, I need Readability.article, it's my code:

case HTTPoison.get("http://zh.html.net/tutorials/css/lesson3.php", @headers, @request_options) do
      {:ok, response} ->
        case response.status_code do
          200 ->
            response.body
            |> IO.inspect
            |> Readability.article
            |> IO.inspect
          _ ->
            "no match"
        end
      {:error, _response} ->
        IO.inspect "BAD LINK 4xx"
      _ ->
        IO.inspect "BAD LINK 5xx"
    end

when the url = "http://zh.html.net/tutorials/css/lesson3.php", it fails, and alarm:

** (FunctionClauseError) no function clause matching in Floki.HTMLTree.build/1
(floki) lib/floki/html_tree.ex:14: Floki.HTMLTree.build(nil)
(floki) lib/floki/finder.ex:48: Floki.Finder.find_selectors/2
(floki) lib/floki/filter_out.ex:17: Floki.FilterOut.filter_out/2
(floki) lib/floki.ex:210: Floki.text/2
(readability) lib/readability/helper.ex:75: Readability.Helper.text_length/1
(readability) lib/readability/article_builder.ex:36: Readability.ArticleBuilder.build/2

when the url = "http://html.net/tutorials/css/lesson3.php", it works well.

so it seems support Chiness not well.

from readability.

Valian avatar Valian commented on May 25, 2024

It's a very old issue, and for me it works with the newest version just fine (v0.12.0). Closing as no longer relevant, please open a new issue if something doesn't work as expected.

from readability.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.