Skip to content

Splash XML Issue  #1

@Megodoody

Description

@Megodoody

Alsalam Alikom Mr. Ahmed,

I am facing a problem when I executing this code, I am new to python and webscraping .
the output comes like this only : [ ]
I have tried to troubleshoot it but I couldn't.

thank you in advance

the code:

import requests
from lxml import html

script = '''
assert(splash:go(args.url))
splash:wait(5.5)
return {
html = splash:html()
}
'''

response = requests.post(url="http://localhost:8050/run", json={
"lua_source":script,
"url":"https://axie.zone/finder?search=view_genes"
})

tree = html.fromstring(response.content)
products = tree.xpath("//div[contains(@Class,'content')]")

all_products = []
for product in products:

item = {
    "Price":product.xpath(".//*[@id='search_result_container']/div[1]/a/div[7]/text()"),

}

all_products.append(item) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions