Re: Problem when scraping the 100 Movie titles.
I have done some webscraping before i think you need to get a slightly more tactical way to get these titles scraped . Try to see what classes identify the cards (in which movie title is given) and then try to pull the heading out of those. Try to get the divs in a list , something like this "" in my case and then try to pull the h3 tag out of it . Onething to note is react os single page heavy webapps have seemed to be difficult to scrape maybe beautiful isnt made for JSX . On Thu, Feb 18, 2021 at 9:09 PM Bischoop wrote: > > I'm learning Scraping actually and would like to scrape the movie titles > from https://www.empireonline.com/movies/features/best-movies-2 . > In the course I was learning I was supposed to do it with bs4: > titles = soup.find_all(name = 'h3', class_ = 'title') > > but after after a while I guess the site has changed and now the class > is: jsx-2692754980 > > 100) Stand By Me > > but anyway if I do try get those titles by name and class, my list is > empty: > titles = soup.find_all(name = 'h3', class_ = 'jsx-2692754980') > > I tried also selenium and manage get those titles with: > driver.get('https://www.empireonline.com/movies/features/best-movies-2') > > #driver.find_element_by_xpath('/html/body/div/div[3]/div[5]/button[2]').click() > > titles = driver.find_elements_by_css_selector("h3.jsx-2692754980") > > tit=[] > for e in titles: > tit.append(e.text) > > print(tit) > > But in Chrome I get a popup asking to accept cookies and I need to > click to accept them. > > Is someone here who knows how can I get those titles with BeautifulSoup > and how to deal with > cookies if using Selenium? > > -- > Thanks > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
[no subject]
Julia is a rapidly progressing language directly attacking python's sweet spot in a.i , m.l and other computational areas. I love python and want it to remain undefeated . I think its time we create a compiler for python . So that python can be compiled and interpreted at will . Its time we make our snake go faster than the world.(and most importantly Julia) -- https://mail.python.org/mailman/listinfo/python-list
Re: Fun with IO
i have been fairly confused as to what would be the best option for an all in all python compiler (i am talking the cpython , number type compiler) to use for basic projects. Like sorting and searching algorithms to be replicated without use of any builtins. Please help On Tue, 21 Jan 2020, 9:52 pm Maxime S Hi, > > Le ven. 17 janv. 2020 à 20:11, Frank Millman a écrit > : > > > > It works perfectly. However, some pdf's can be large, and there could be > > concurrent requests, so I wanted to minimise the memory footprint. So I > > tried passing the client_writer directly to the handler - > > > > await pdf_handler(client_writer) > > client_writer.write(b'\r\n') > > > > It works! ReportLab accepts client_writer as a file-like object, and > > writes to it directly. I cannot use chunking, so I just let it do its > > thing. > > > > Can anyone see any problem with this? > > > > > If the socket is slower than the PDF generation (which is probably always > the case, unless you have a very fast network), it will still have to be > buffered in memory (in this case in the writer buffer). Since writer.write > is non-blocking but is not a coroutine, it has to buffer. There is an > interesting blog post about that here that I recommend reading: > https://lucumr.pocoo.org/2020/1/1/async-pressure/ > > Unfortunately, there is no way to avoid buffering the entire pdf in memory > without modifying reportlab to make it async-aware. > > This version is still better than the one with BytesIO though because in > that version the pdf was buffered twice, once in BytesIO and once in the > writer, although you can fix that by using await writer.drain() after each > write and then the two versions are essentially equivalent. > > Regards, > > Maxime. > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Fun with IO
i mean numba instead of number ☺ On Wed, 22 Jan 2020, 1:34 am AAKASH JANA i have been fairly confused as to what would be the best option for an all > in all python compiler (i am talking the cpython , number type compiler) to > use for basic projects. Like sorting and searching algorithms to be > replicated without use of any builtins. Please help > > On Tue, 21 Jan 2020, 9:52 pm Maxime S >> Hi, >> >> Le ven. 17 janv. 2020 à 20:11, Frank Millman a >> écrit : >> >> >> > It works perfectly. However, some pdf's can be large, and there could be >> > concurrent requests, so I wanted to minimise the memory footprint. So I >> > tried passing the client_writer directly to the handler - >> > >> > await pdf_handler(client_writer) >> > client_writer.write(b'\r\n') >> > >> > It works! ReportLab accepts client_writer as a file-like object, and >> > writes to it directly. I cannot use chunking, so I just let it do its >> > thing. >> > >> > Can anyone see any problem with this? >> > >> > >> If the socket is slower than the PDF generation (which is probably always >> the case, unless you have a very fast network), it will still have to be >> buffered in memory (in this case in the writer buffer). Since writer.write >> is non-blocking but is not a coroutine, it has to buffer. There is an >> interesting blog post about that here that I recommend reading: >> https://lucumr.pocoo.org/2020/1/1/async-pressure/ >> >> Unfortunately, there is no way to avoid buffering the entire pdf in memory >> without modifying reportlab to make it async-aware. >> >> This version is still better than the one with BytesIO though because in >> that version the pdf was buffered twice, once in BytesIO and once in the >> writer, although you can fix that by using await writer.drain() after each >> write and then the two versions are essentially equivalent. >> >> Regards, >> >> Maxime. >> -- >> https://mail.python.org/mailman/listinfo/python-list >> > -- https://mail.python.org/mailman/listinfo/python-list
Re: How to get a place's longitude and latitude?
You might use webscraping with requests and beautiful soup to scrape up some website for that gives such utility On Mon, 24 Feb 2020, 9:36 pm Souvik Dutta Hi guys I want to make a program that kinda sends an sos message with the > measures of longitude and latitude (which is super inconvenient) to > someone. How can I do that I mean how can I get the longitude and latitude? > Any help would be appreciated. > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Difficulty in generating .exe from .py file
I have made a simple web scraper that scrapes Wikipedia and prints some info on to the command line using requests and BeautifulSoup. Whenever I execute pyinstaller it gives an error "expected integer got type bytes" although the code runs perfectly. I am using python 3.8 -- https://mail.python.org/mailman/listinfo/python-list
Floating point issue
I am calculating couple of ratios and according to the problem there must be a 6 decimal precision. But when I print the result I only get one 0. E.g:- 2 / 5 = 0.40 but I am only getting 0.4 On Fri, 17 Apr 2020, 4:08 am Muneer Malla Dear All > hope you all are fine and doing good in these critical conditions > While I am need to Python > And I a generally using it in running a software QIIME > in virtual machine (Linux based). > I need to install python 3.7 or above version, however the previously > installed version is python2.7 > I tried many commands > sudo apt-get install python3.8 > after running the command it fails > I removed pthon 2.7 > but again when I run the command > Python --version > it again shows python 2.7 > please suggest the commands > I have my python version 3.8 downloaded in the download folder > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Floating point problem
I am calculating couple of ratios and according to the problem there must be a 6 decimal precision. But when I print the result I only get one 0. E.g:- 2 / 5 = 0.40 but I am only getting 0.4 -- https://mail.python.org/mailman/listinfo/python-list
Re: Floating point problem
I am running python 3.8 only but my issue is I need more zeroes after my result. I want 2/5 = 0.40 But I am only getting 0.4 On Fri, 17 Apr 2020, 5:08 pm Peter Otten <__pete...@web.de wrote: > Aakash Jana wrote: > > > I am calculating couple of ratios and according to the problem there must > > be a 6 decimal precision. But when I print the result I only get one 0. > > E.g:- 2 / 5 = 0.40 but I am only getting 0.4 > > Make sure that you are using Python 3, not Python 2 or use at least one > float operand: > > # Python 3 > >>> 2/5 > 0.4 > > # Python 2 and 3 > >>> 2.0 / 5 > 0.4 > > You can get the old default behaviour with the // operator: > > # Python 3 (and Python 2) > >>> 2//5 > 0 > >>> 7//2 > 3 > > If for some reason you cannot switch to Python 3 you can add the line > > from __future__ import division > > at the top of your script or module. Then: > > $ python > Python 2.7.6 (default, Nov 13 2018, 12:45:42) > [GCC 4.8.4] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from __future__ import division > >>> 2 / 5 > 0.4 > > > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Floating point problem
I am really enlightened by the amount of knowledge I received from a question that seemed so little to me. 😅 On Sat, 18 Apr 2020, 8:08 pm Souvik Dutta Hmm understood. > > Souvik flutter dev > > On Sat, Apr 18, 2020, 7:36 PM Chris Angelico wrote: > > > On Sun, Apr 19, 2020 at 12:03 AM Souvik Dutta > > wrote: > > > > > > I literally tried it!!! And it did not stop because I did not get any > 1.0 > > > rather I got 0.999 But why does this happen. This is a simple > > math > > > which according to normal human logic should give perfect numbers which > > are > > > not endless. Then why does a computer behave so differently? > > > > > > > If you add 0.333 and 0.333 and 0.333, do you get 1.0? No, you get > > 0.999. But if you add 1/3 and 1/3 and 1/3, you get 1. The computer has > > to round, same as you do - it doesn't have infinite precision. The > > truth is that the number 0.1, to a computer, is not actually one tenth > > - it's an approximation for one tenth, just as 0.333 is an > > approximation for one third. > > > > ChrisA > > -- > > https://mail.python.org/mailman/listinfo/python-list > > > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Pip not working on windows
I recently upgraded pip to version 20.1 and now whenever I try pup install on my PC I get the following error :- Fatal error in launcher : unable to create process using '"c:\python38\python.exe ' "c:\Python38\Scripts\pip.exe" : The system cannot find the file specified. But when I manually inspected the folder 📂 the files were there I even tried upgrading it by python -m pip install --upgrade pip which worked but I still can not use pip. -- https://mail.python.org/mailman/listinfo/python-list
Re: Pip not working on windows
Yes, I am! On Sun, 3 May 2020, 9:39 pm joseph pareti are you doing *pip** install* from Windows cmd of from Anaconda prompt? I > used the latter and it works > > Am So., 3. Mai 2020 um 16:48 Uhr schrieb Aakash Jana < > aakashjana2...@gmail.com>: > >> I recently upgraded pip to version 20.1 and now whenever I try pup install >> on my PC I get the following error :- Fatal error in launcher : unable to >> create process using '"c:\python38\python.exe ' >> "c:\Python38\Scripts\pip.exe" : The system cannot find the file specified. >> But when I manually inspected the folder 📂 the files were there I even >> tried upgrading it by python -m pip install --upgrade pip which worked but >> I still can not use pip. >> -- >> https://mail.python.org/mailman/listinfo/python-list >> > > > -- > Regards, > Joseph Pareti - Artificial Intelligence consultant > Joseph Pareti's AI Consulting Services > https://www.joepareti54-ai.com/ > cell +49 1520 1600 209 > cell +39 339 797 0644 > -- https://mail.python.org/mailman/listinfo/python-list