scrapy css selector returning None then finds value

So basically I am adding this portion to my code and I have no clue whats going on. This is the link i am using All in the same Process: -So my css selector returns none. -Then it finds a couple of the html elements returns some of them. -Then finds the last element. So this is causing my program to mix match data and yields it incorrectly to my csv file. If anyone could tell me what the problem is here? Thanks. Code Output Answer I highly recommend you to switch to XPath expressions:

python selenium cannot locate clickable play button on mobile version of webpage

I am having a hard time locating the play element on a mobile version of a webpage (my python script is passing a mobile user-agent in the header.) the website url is below (NOTE: must be accessed with a mobile user-agent else it won’t show the correct page and reverts to standard browser page instead) Using inspect in the browser, I have been unable to work out what exactly is needing to be clicked to start it playing. The entire image area around the play button seems to work if I click on it manually, but no element listed

Extract two div tags in one BS find_all

Is it possible to extract two HTML div tags in one “soup.find_all” with beautifulSoup? The divs are repeatedly called “event odd”, “event even” and i want to loop through them all webpage code: My code: concerts = soup.find_all([‘div’, {‘class’: ‘event odd’}, {‘class’: ‘event even’}]) Answer You can use Bitto Bennichan’s suggestion of using {‘class’: ‘event’}. Or, if you must specify two values at once, you can pass them in a list:

How to click a button on a website by finding its id

When I run the code, the website loads up fine but then it won’t click on the button- an error appears saying the element is not interacterble. What do I need to do to click the button? I am relatively new to this and would be grateful for any help. I have already tried finding it by id and tag. SOLVED: I used driver.find_element_by_link_text and this worked fine. Answer I have checked the website and noticed that mk-button-31 is an id for a div tag and inside it there is an a tag. Try getting the url from the a

How to show more objects in my html with django (queries)

I want to show more queries within my html page but it only shows a single object. I do not know how to add more This is in mysql, html, django1.11 and python 2.7.15 i need add object mapa and competencias. The object alumno i dont have problem Answer User filter instead of get. Because, get returns a single object, but filter returns all matching objects. In your template For Alumnao, For mapa, For competencias,

Django stops with “generator raised StopIteration” when html form allows for file upload

My setup is Windows 10, Python 3.7, Apache 2.4/mod_wsgi. When I add this enctype=”multipart/form-data” in my form (just by adding this attribute, only — no files are attached to the form) I get this error when submitting: My Django code is this: And this is full traceback: Any ideas what is going wrong? PS: Same django application worked fine in Linux/Nginx/Gunicorn/Python2.7 setup. So, I guess it must some misconfiguration between Django/Python/Apache. Answer Your Django is very old and you need to update. This is a Python 3.7 compatibility problem that the Django devs already fixed four years ago, back when

How do I get my HTML button to delete the right list item from a SQLite database?

I’m a beginner, so forgive any stupidity in advance. I’m using Flask (and by extension Jinja2) to create a simple web app — one that basically lets you type a movie into a web form, which adds it to a SQLite database. I’ve gotten Flask to very nicely iterate through all the movies in the database and print them to the page upon load. I want to include a “Delete” button next to each movie. Getting the button to appear is simple. But I’m not sure how to tie the button back to the function delete_movie() such that it will