User Tools

Site Tools


task_boiler

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
task_boiler [2023/05/03 16:17] admintask_boiler [2024/01/22 22:59] – [Issue] raju
Line 4: Line 4:
 Start the first heading with "=====" Start the first heading with "====="
  
-===== find depth ===== +===== blocked by barrons ===== 
-==== find depth of a file or directory ====+==== Issue ==== 
 +barrons.com is giving the following error.
 <code> <code>
-import os +You have been blocked.
-  +
-def get_depth(file_or_dir_path): +
-    abs_path = os.path.abspath(os.path.expanduser(file_or_dir_path)) +
-    depth = os.path.normpath(abs_path).count(os.sep) +
-    return depth +
-</code>+
  
-Examples: +Why? 
-<code> +Something about the behaviour of the browser has caught our 
-In [2]:  +attention.
-os.path.abspath(os.path.expanduser('~')) +
-Out[2]:  +
-'/home/rajulocal'+
  
-In [3]:  +There are various possible explanations for this
-get_depth('~') +* You are browsing and clicking at a speed much faster than 
-Out[3]:  +  expected of a human being. 
-2+* Something is preventing JavaScript from working on your 
 +  computer. 
 +* There is a robot on the same network (IP WW.XX.YY.ZZ) as you.
  
-In [4]:  +Having problems accessing the site? Submit feedback. 
-get_depth('/home/rajulocal'+IDa-b-c-d-e 
-Out[4]:  +</code>
-2+
  
-In [5]:  +==== Solution ==== 
-get_depth('/home/rajulocal/') +Click on the extensions button in the top right 
-Out[5]:  +-> Bypass Paywalls Clean -> settings button -> Options 
-2 +-> scroll down to "BPC settings" section 
- +-> check "Barron's - no Googlebot (http error 500)" option 
-In [6]:  +-Save
-get_depth('/home/rajulocal/foo'+
-Out[6]:  +
-+
- +
-In [7]:  +
-get_depth('/'+
-Out[7]:  +
-+
- +
-In [8]:  +
-get_depth('/home'+
-Out[8]:  +
-+
-</code>+
  
-Using Python 3.10.6, Ipython 8.6.0+==== System Information ==== 
 +  * bypass paywalls clean extension version: 3.5.2.1 (latest asof 2024-01-22) 
 +  * google chrome: 120.0.6099.200 
 +  * OS: Windows 10 Enterprise
  
-tags | get depth of a directory 
task_boiler.txt · Last modified: 2024/01/23 22:55 by raju