Home > front end >  python merge df of scraping
python merge df of scraping

Time:03-29

i need your help to join two data frame of two sector table scrapings

the sample url of many is results

results2 like these

enter image description here

CodePudding user response:

just had to extract the unique value before on the first part sorry for the question I will not delete it since maybe is helpulf for someone

url=i

    soup = BeautifulSoup(requests.get(i).content, "html.parser")
    licitation_number = soup.select_one("#lblNumLicitacion").text
    responsable = soup.select_one("#lblResponsable").text
    ficha = soup.select_one("#lblFicha2Reclamo").text
    nombre_licitacion=soup.select_one("#lblNombreLicitacion").text
    monto=soup.select_one("#lblFicha1Tipo").text# here is the answer
    #print(f"{licitation_number=}")
    #print(f"{responsable=}")
    #print(f"{ficha=}")
    #print(f"{nombre_licitacion=}")
    #print(f"#lblFicha1Tipo")
    #print("-" * 80)
  • Related