Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

80
Vistas
What is the best method to copy all matching text from a web page?

Background I have a live web dashboard for ticket numbers and their status updates. Each update and case number are in separate rows on this web page. To make this dashboard useful, I have to save it as offline HTML and import it into excel to copy one row of data like all case numbers.

Goal How do I search for a matching string on a page and copy all to clipboard in separate lines? EG, all my case numbers match the first two digits like “12.......” If I can manage to figure that out, I can make use of text in tools easier like Trello etc.

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You could do something like this with Python:

import re
import requests

text = input("Enter text: ")

url = requests.get('https://stackoverflow.com/questions/69691849/what-is-the-best-method-to-copy-all-matching-text-from-a-web-page').text
page = re.findall(text, url)

for i in page:
    print(i)

I don't think you'd be able to copy all the output, however you could just copy the output from command prompt. It's unclear what you are trying to fully achieve here.

Output:

Output with array ( print(page) ):

7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos