256 Kilobytes

Scripting and Automation

Type All Category Scripting and AutomationInformation and discussion of scripting of various types. Tag All

Profile Photo - August R. Garcia

Spit in the Face of God: Five Tasks You Didn’t Know Could be Done with Google Sheets

Articles in Spreadsheets | By August R. Garcia

Published 1 year agoTue, 12 Feb 2019 07:53:13 -0800 | Last update 1 year agoThu, 28 Feb 2019 22:37:26 -0800 📌

Profile Photo - Hash Brown

Last Reply Any opportunity to spit in the face of god is good by me. Excellent post homie.  Hash Brown,

Any opportunity to spit i...

Mon, 27 May 2019 07:59:54 -0700 10 months ago
🗨
2
🐏
2
👁
2,267
Profile Photo - Hash Brown

An introduction to scraping with Python and BeautifulSoup

Articles in Web Scraping, Data Analysis | By Hash Brown

Published 1 year agoTue, 08 Jan 2019 22:34:09 -0800 | Last update 1 year agoMon, 11 Mar 2019 22:19:33 -0700 📌

Profile Photo - August R. Garcia

Last Reply Very nice, as they say. Other scraping methods For those who don’t perhaps have the skills needed to code something there are also other... August R. Garcia,

Very nice, as they say.

Wed, 09 Jan 2019 03:16:31 -0800 1 year ago
🗨
1
🐏
1
👁
1,674
Profile Photo - Some Guy
Profile Photo - rahuldev

Last Reply When we try to use float numbers in Python range() function, we get a type error 'float' object that cannot be interpreted as an integer.&nb... rahuldev,

When we try to use float...

Tue, 24 Mar 2020 04:03:43 -0700 2 weeks ago
🗨
2
🐏
0
👁
2,294
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last Reply Explicitly cast the int object to a string: x = 10 # Integer print("X is set to " + str(10)) # Explicitly a string August R. Garcia,

Explicitly cast the int o...

Wed, 05 Feb 2020 13:31:04 -0800 2 months ago
🗨
3
🐏
0
👁
509
Profile Photo - Default

TestNG Interview Questions and Answers

Forum in Scripting and Automation | By deep986

Published 2 months agoSat, 01 Feb 2020 02:25:07 -0800

Profile Photo - ThanhKim

Last Reply Wait, is this a spam post? You got me. ThanhKim,

Wait, is this a spam post...

Sun, 02 Feb 2020 23:00:02 -0800 2 months ago
🗨
2
🐏
0
👁
253
Profile Photo - Some Guy

Fix "typeerror: 'module' object is not callable"?

Answers in Scripting and Automation | By Some Guy

Published 1 year agoSun, 16 Dec 2018 09:37:24 -0800

Profile Photo - August R. Garcia

Last Reply This error is likely occurring because of code that involves a module that contains a function that has the same name as the module. For example, the... August R. Garcia,

This error is likely occu...

Tue, 31 Dec 2019 10:29:43 -0800 3 months ago
🗨
2
🐏
0
👁
238
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last Reply If there are some scenarios where the value is actually not intended to be a number, this can also be solved with a try-catch block: try: #... August R. Garcia,

If there are some scenari...

Tue, 03 Dec 2019 13:33:18 -0800 4 months ago
🗨
2
🐏
0
👁
6,524
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last Reply It's possible that if you have an array of values that you believe to be integers, that at some point they were converted to floats. Try printing out... August R. Garcia,

It's possible that if you...

Mon, 11 Nov 2019 08:22:53 -0800 4 months ago
🗨
1
🐏
0
👁
1,217
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

Alternatively "TypeError: %o format: an...

MoreThis is technically a different error message, but is what was causing the issue. string = "The value is one hundred (100)." # Raises an error...
🗨
0
🐏
0
👁
136
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

TFW

MoreSee code. Yeah, it seems like you do in fact have to make a bunch of additional HTTP requests. def resolve_t_co(t_co_url): if t_co_url !...
🗨
0
🐏
1
👁
165
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last Reply What the fuck is this question. This is like eight different errors. The answer is probably to cast something as something else. Look at this thread:... August R. Garcia,

What the fuck is this que...

Thu, 17 Oct 2019 14:04:45 -0700 5 months ago
🗨
1
🐏
0
👁
214
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last Reply Cast the integer to be a string. # Probably something like this is causing the error x = 3 text = "whatever" # "TypeError: unsupported op... August R. Garcia,

Cast the integer to be a...

Thu, 17 Oct 2019 14:03:15 -0700 5 months ago
🗨
2
🐏
0
👁
2,224
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

It's time to post code so that I can fin...

MoreIt's time to post code so that I can find this the next eight times I need to do this: # ##### ##### ################# ##### ##### # # ##### ###...
🗨
0
🐏
0
👁
129
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

Last Reply Here's a better version that removes the " results" string and then casts the result to a number instead of a string: =VALUE(substitute(importXML... August R. Garcia,

Here's a better version t...

Tue, 08 Oct 2019 09:17:50 -0700 5 months ago
🗨
1
🐏
0
👁
297
Profile Photo - August R. Garcia

[Solved] Python - Getting the remote/server IP address and port from an HTTP response using the requests library?

Answers in Web Scraping, Data Analysis | By August R. Garcia

Published 6 months agoWed, 25 Sep 2019 15:54:55 -0700 | Last update 6 months agoThu, 26 Sep 2019 13:25:27 -0700

Profile Photo - August R. Garcia

Some edge case what even is this.

MoreThe solution here seems to generally work: https://stackoverflow.com/questions/22492484/how-do-i-get-the-ip-address-from-a-http-request-using-th...
🗨
0
🐏
0
👁
378
Profile Photo - August R. Garcia

How to Make a Simple, Automatically-Updating Dashboard for Python Scripts Using HTML, JavaScript, and JSONP

Articles in Scripting and Automation | By August R. Garcia

Published 7 months agoThu, 05 Sep 2019 04:39:30 -0700 | Last update 7 months agoThu, 05 Sep 2019 05:15:22 -0700

Profile Photo - Default

Last Reply Thank you for the post. Blogger at Radio Box https://www.youtube.com/watch?v=Jfh_qbzhUKI RadioBox,

Thank you for the post.

Sat, 21 Sep 2019 04:07:21 -0700 6 months ago
🗨
2
🐏
1
👁
636
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

Currently: Python, Bash

MoreSee: Correct Horse Battery Staple from XKCD, if somehow you haven't seen this before. There's also a generator that can be used here. How to...
🗨
0
🐏
1
👁
180
Profile Photo - August R. Garcia

[Solved] How to Get Random Punctuation in Python

Answers in Scripting and Automation | By August R. Garcia

Published 6 months agoMon, 16 Sep 2019 19:14:26 -0700

Profile Photo - August R. Garcia

Code:

MoreCode: # string.punctuation contains the following characters: # !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ import random, string print( rand...
🗨
0
🐏
0
👁
177
Profile Photo - August R. Garcia

[Solved] How to immediately kill all Python threads when working with multithreading

Answers in Scripting and Automation | By August R. Garcia

Published 6 months agoSun, 15 Sep 2019 17:06:46 -0700 | Last update 6 months agoSun, 15 Sep 2019 20:49:11 -0700

Profile Photo - August R. Garcia

why is this answer so hard to find

MoreNormally, to kill a Python script while it is running, pressing CTRL+C will work. However, if there are multiple threads running because the program i...
🗨
0
🐏
0
👁
882
Profile Photo - August R. Garcia

[Solved] Color code HTTP status codes in Python

Answers in Web Scraping, Data Analysis | By August R. Garcia

Published 8 months agoMon, 29 Jul 2019 22:34:12 -0700

Profile Photo - August R. Garcia

Last Reply For Python 3: import http.client [...] try: msg = " " + http.client.responses[status_code] [...] Code is basically th... August R. Garcia,

For Python 3:

Mon, 09 Sep 2019 12:10:10 -0700 6 months ago
🗨
1
🐏
0
👁
291
Profile Photo - Some Guy

Solve "Typeerror: unhashable type: 'list'"?

Answers in Scripting and Automation | By Some Guy

Published 1 year agoSun, 16 Dec 2018 09:34:42 -0800

Profile Photo - August R. Garcia

Last Reply Ran into this like five minutes ago and found this fucking thread in the SERPs. What a shitty fucking thread that did not answer my question. Anyway,... August R. Garcia,

Ran into this like five m...

Thu, 05 Sep 2019 07:50:44 -0700 7 months ago
🗨
2
🐏
0
👁
601
Profile Photo - August R. Garcia

The Basics to Web Scraping with cURL and XPath

Articles in Web Scraping, Data Analysis | By August R. Garcia

Published 9 months agoFri, 28 Jun 2019 09:02:04 -0700 | Last update 9 months agoTue, 02 Jul 2019 17:37:33 -0700

Profile Photo - August R. Garcia

Last Reply Bump. Some more cURL, used to determine the quality of proxygo's proxies: for i in {1..48} ; do curl https://www.blackhatworld.com/seo/ssl-proxi... August R. Garcia,

Bump. Some more cURL, use...

Thu, 29 Aug 2019 18:31:09 -0700 7 months ago
🗨
4
🐏
2
👁
8,138
Profile Photo - August R. Garcia

[Solved] Basic progress bar functionality with Python

Answers in Scripting and Automation | By August R. Garcia

Published 7 months agoSun, 25 Aug 2019 12:04:00 -0700 | Last update 7 months agoSun, 25 Aug 2019 12:06:08 -0700

Profile Photo - August R. Garcia

Commentary is hard. Use your reading ski...

MoreCommentary is hard. Use your reading skills to read this code: #!/usr/bin/env python # -*- coding: utf-8 -*- import time import sys from...
🗨
0
🐏
0
👁
214
Profile Photo - August R. Garcia

[Solved] How to Show Number of Remaining Threads in Python

Answers in Scripting and Automation | By August R. Garcia

Published 7 months agoFri, 16 Aug 2019 06:38:19 -0700 | Last update 7 months agoMon, 26 Aug 2019 01:21:58 -0700

Profile Photo - August R. Garcia

Self explanatory, mostly.

MoreSelf explanatory, mostly. Original Code import Queue from threading import Thread, active_count import time que = Queue.Queue()...
🗨
0
🐏
0
👁
194
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

The answer is to fucking kill yourself.<...

MoreThe answer is to fucking kill yourself.
🗨
0
🐏
0
👁
253
Profile Photo - August R. Garcia

[Solved, Basically] Nautilus - Open Multiple Tabs from Command Line?

Answers in Shell Scripting | By August R. Garcia

Published 8 months agoSat, 20 Jul 2019 23:22:36 -0700 | Last update 8 months agoSat, 20 Jul 2019 23:22:46 -0700

Profile Photo - August R. Garcia

How to open multiple GUI file manager ta...

MoreThe answer is that there's no built in option to do this in Nautilus, although there are Stack Exchange threads discussing ghetto hack workarounds....
🗨
0
🐏
2
👁
231
Profile Photo - August R. Garcia

[BASH, cURL] Yellow Pages Scraper: Fully Functional Script with Source Code

Articles in Web Scraping, Data Analysis | By August R. Garcia

Published 9 months agoFri, 05 Jul 2019 23:22:06 -0700 | Last update 9 months agoSat, 06 Jul 2019 01:44:02 -0700

Profile Photo - August R. Garcia

What a nice, free YellowPages scraper.

MoreEdit: When trying to scrape indefinitely (~100+ pages), there's some buggy behavior with exit conditions currently. If/when an updated script is poste...
🗨
0
🐏
1
👁
468
Profile Photo - August R. Garcia

Downloading Bulk Images: ThisPersonDoesNotExist with Python and urllib2

Articles in Web Scraping, Data Analysis | By August R. Garcia

Published 1 year agoThu, 14 Mar 2019 06:25:36 -0700 | Last update 1 year agoThu, 14 Mar 2019 08:05:08 -0700

Profile Photo - August R. Garcia

Last Reply Here's a shorter version with cURL and BASH that does basically the same thing: for i in $( seq 1 10 ) ; do curl --user-agent "Some User-Agent St... August R. Garcia,

Here's a shorter version...

Thu, 04 Jul 2019 12:56:36 -0700 9 months ago
🗨
2
🐏
0
👁
3,992
Profile Photo - August R. Garcia

[cURL, BASH] How to Crawl and Scrape DuckDuckGo Search Results

Articles in Web Scraping, Data Analysis | By August R. Garcia

Published 9 months agoTue, 02 Jul 2019 17:29:24 -0700 | Last update 9 months agoThu, 04 Jul 2019 19:21:52 -0700

Profile Photo - August R. Garcia

You can use these same concepts to build...

MoreAs discussed recently, it is relatively easy to scrap various arbitrary pieces of data using cURL (and XPath). You can use these same concepts to buil...
🗨
0
🐏
1
👁
1,569
Profile Photo - Some Guy

The Easiest Way to Build a Reddit Bot?

Forum in Scripting and Automation | By Some Guy

Published 1 year agoSun, 16 Dec 2018 09:40:29 -0800 | Last update 9 months agoSun, 30 Jun 2019 14:54:21 -0700

Profile Photo - August R. Garcia

Last Reply Also, see this post. Could probably do something similar, depending on use case: https://www.256kilobytes.com/content/show/10842/the-basics-to-w... August R. Garcia,

Also, see this post. Coul...

Sun, 30 Jun 2019 14:54:58 -0700 9 months ago
🗨
2
🐏
0
👁
337