R
R
reverend-dikiy2021-05-04 11:49:52
Python
reverend-dikiy, 2021-05-04 11:49:52

How to get a tag in python selenium?

60910a6801390065654856.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
herypank, 2021-05-04
@revrend-dikiy

It was worth specifying the code in something like this

<div class="question__body">
  <div class="question__text js-question-text" itemprop="text description">
    <img src="https://habrastorage.org/webt/60/91/0a/60910a6801390065654856.png" alt="60910a6801390065654856.png">  </div>
      <ul class="question__attrs inline-list">
      <li class="inline-list__item inline-list__item_bullet">
        <span class="question__pub-date">
          Вопрос задан
          <time pubdate="" itemprop="dateCreated" datetime="2021-05-04 11:49:52" title="Дата публикации: 04 мая 2021, в 11:49">
            8 часов назад          </time>
                  </span>
      </li>
              <li class="inline-list__item inline-list__item_bullet">
          <span class="question__views-count question__views-count_full">40 просмотров</span>
        </li>
                </ul>
    </div>

Look for a button like this should be "< / >" when typing a question
The answer to your question is simple, most likely it will work.
driver.find_element_by_css_selector('div a[style]')

In general, I advise you to read the
dock of our all (selenium)
css selectors
if you want something more powerful than
xpath selectors
more than xpath

D
Dimonchik, 2021-05-04
@dimonchik2013

find_element (By TAG)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question