Can't detect text in <strong> tags

Open
#565 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start with the Article.download() and Article.parse() entry points shown in the report, then trace how the downloaded HTML is converted into article.text. Reproduce the example URL and verify that text inside tags is retained with appropriate spacing, while the surrounding article text remains intact.

Written by the indexing model from the issue text.

Description

Hi,

I'm having problems parsing news from a site, here is an example: https://www.am.com.mx/2018/05/14/mexico/detienen-a-tres-integrantes-de-grupo-delictivo-y-liberan-a-secuestrado-470894

The crawler just ignores the text between strong tags and continues with the rest.

Here's some proof code:

>>> article = Article('https://www.am.com.mx/2018/05/14/mexico/detienen-a-tres-integrantes-de-grupo-delictivo-y-liberan-a-secuestrado-470894')
>>> article.download()
>>> article.html
'... <br>Elementos de la<strong> PGR, en coordinaci&oacute;n con la Marina Armada de M&eacute;xico,</strong> detuvieron a tres integrantes del <strong>c&aacute;rtel de Jalisco Nueva Generaci&oacute;n</strong> ...'
>>> article.parse()
>>> article.text
'... Elementos de ladetuvieron a tres integrantes dely ...'

If someone knows how to fix this issue, it'd be a big help.

Dominant language
Python
Stars
15.2k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from codelucas/newspaper

All issues in codelucas/newspaper

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.