T
T
Tem4ikArtem4ik2021-05-28 15:55:06
opencart
Tem4ikArtem4ik, 2021-05-28 15:55:06

Extract information from a string?

There is a line:

[<div class="profile_online_lv">заходил сегодня в 11:05</div>]

You need to pull it out of it: I went in today at 11:05
How to do it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zoozag, 2019-01-17
@zoozag

If the question concerns only color. You need a module like Options Image.
If you want to implement the functionality, as in the first example, you can use the related options module as a basis.
You can describe the desired functionality to the author of these modules, he will tell you which of the modules are best suited. And then there are simple and PRO versions.

V
Vladimir Kuts, 2021-05-28
@Tem4ikArtem4ik

from lxml import etree

a = '[<div class="profile_online_lv">заходил сегодня в 11:05</div>]'
root = etree.fromstring(a[1:-1])
print(root.text)
# заходил сегодня в 11:05

Y
Yupiter7575, 2021-05-28
@yupiter7575

Read about bs4

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question