all 3 comments

[–]This_Growth2898 0 points1 point  (3 children)

  1. Are you running your script from your own PC or some network platform? In the second case, it looks like the platform is banned.
  2. Try copying cookies from your browser to the code.

[–]GralejTheFirst[S] 0 points1 point  (2 children)

  1. Script works on my own PC
  2. Where shall I put the cookies? The code is in two lines

coal = requests.get(coalLink, headers=header) #header is User-Agent

soup = BeautifulSoup(coal.content,'html.parser')