My code loop through urls but not pages in urls Python

I am trying to extract names and comments from url and my code loops through urls but not pages with in it len(name) gives 37 urls = [‘https://www.f150forum.com/f118/2018-adding-adaptive-cruise-control-415450/’,’https://www.f150forum.com/f118/adaptive-cruise-control-sensor-blockage-446041/’] name=[] for url in urls: with requests.Session() as req: for item in range(1,3): response = req.get(f”{url}index{item}/”) soup = BeautifulSoup(response.content, “html.parser”) posts = soup.find(id = “posts”) threadtitle =…

Details

How extract 7z file

I’m writing an Android application that needs to extract 7z archives to a specific folder in External Storage and use Apache commons, but after run my app gets this error void unzip7z() { try { SevenZFile sevenZFile = new SevenZFile(new File(Environment.getExternalStorageDirectory() + “/images.7z”)); SevenZArchiveEntry entry = sevenZFile.getNextEntry(); while (entry != null) { System.out.println(entry.getName()); FileOutputStream out…

Details

PHP Static Class Auto Reset

I’m writing a class that I plan to only call statically and I noticed something I wasn’t expecting. Consider the following code. <?php class greeting { public static $greetingMSG; public static function setGreeting(string $greeting){ self::$greetingMSG = $greeting; return new static; } public static function greet() { echo self::$greetingMSG; } } greeting::greet(); greeting::setGreeting(‘Hello World!’)->greet(); greeting::greet(); ?>…

Details

How to download data from a password protected website

I’m using request in python to try and download this file: http://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL1.003/2000.02.11/N55W003.SRTMGL1.hgt.zip there are 14000 such files hence why I need to automate the process. The other techniques I’ve found online don’t seem to work. I assume due the websites they are designed for using a different authentication method. I don’t know much about web…

Details