Small problem on regex!

synnc

Новичок
Регистрация
19.04.2017
Сообщения
1
Благодарностей
0
Баллы
1
Hello,
Im trying to create a kodi addon and trying to scrap this html code:
Код:
<div class="flex-row">
                                    <a href="/catalog/a">А</a>
                                    <a href="/catalog/b">B</a>
                                    <a href="/catalog/c">C</a>
                                    <a href="/catalog/d">D</a>
                                    <a href="/catalog/e">E</a>
                                    <a href="/catalog/f">F</a>
                                    <a href="/catalog/g">G</a>
                                    <a href="/catalog/h">H</a>
                                    <a href="/catalog/i">I</a>
                                    <a href="/catalog/j">J</a>
                                    <a href="/catalog/k">K</a>
                                    <a href="/catalog/l">L</a>
                                    <a href="/catalog/m">M</a>
                                    <a href="/catalog/n">N</a>
                                    <a href="/catalog/o">O</a>
                                    <a href="/catalog/p">Р</a>
                                    <a href="/catalog/q">Q</a>
                                    <a href="/catalog/r">R</a>
                                    <a href="/catalog/s">S</a>
                                    <a href="/catalog/t">T</a>
                                    <a href="/catalog/u">U</a>
                                    <a href="/catalog/v">V</a>
                                    <a href="/catalog/w">W</a>
                                    <a href="/catalog/x">X</a>
                                    <a href="/catalog/y">Y</a>

With this code:
Код:
re.compile('<div class="flex-row">.+?<a href="(.+?)">(.+?)</a>',re.DOTALL).findall(r.content)
    for  url, name in match:
          addDir(name, 'http://abcf.xyz%s'%url, '', '')
However only scraps the A letter, and i want them all, can someone give me a tip?
Thanks in advance.
 
Последнее редактирование:

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)