Как эта веб-страница блокирует меня, когда я прохожу цикл, а не когда получаю к нему доступ напрямую?

Вот пример Пример Docstrings в стиле Python в стиле Google о том, как модуль может быть документирован. В основном есть информация о модуле, как его выполнять и информация о переменных уровня модуля и список элементов ToDo.

"""Example Google style docstrings.

This module demonstrates documentation as specified by the `Google
Python Style Guide`_. Docstrings may extend over multiple lines.
Sections are created with a section header and a colon followed by a
block of indented text.

Example:
    Examples can be given using either the ``Example`` or ``Examples``
    sections. Sections support any reStructuredText formatting, including
    literal blocks::

        $ python example_google.py

Section breaks are created by resuming unindented text. Section breaks
are also implicitly created anytime a new section starts.

Attributes:
    module_level_variable1 (int): Module level variables may be documented in
        either the ``Attributes`` section of the module docstring, or in an
        inline docstring immediately following the variable.

        Either form is acceptable, but the two should not be mixed. Choose
        one convention to document module level variables and be consistent
        with it.

Todo:
    * For module TODOs
    * You have to also use ``sphinx.ext.todo`` extension

.. _Google Python Style Guide:   
http://google.github.io/styleguide/pyguide.html

"""

module_level_variable1 = 12345

def my_function():   
    pass 
... 
...

0
задан JChuang 19 March 2019 в 20:11
поделиться

1 ответ

Iterrows возвращает кортеж (индекс, (столбцы)), поэтому решение состоит в том, чтобы разобрать его немного по-другому:

for _,(first_name, last_name) in names.iterrows():
    url = "https://zbmath.org/authors/?q={}+{}".format(first_name, 
    last_name)
    r = requests.get(url)
    html = BeautifulSoup(r.text)
    html=str(html)
    frequency = re.findall('Joint\sPublications">(.*?)</a>', html)
    freq.append(frequency)

print(freq)
0
ответ дан G. Anderson 19 March 2019 в 20:11
поделиться
Другие вопросы по тегам:

Похожие вопросы: