title: Creating very simple cronjob in VScode to execute scraper.py
body: <p>i am trying to learn how to create a cronjob, but there are so many ways to do so...
  It seems none is working for me.</p>
  <p>I have a file named Cron.py:</p>
  <pre><code>from crontab import CronTab
  cron = CronTab()
  my_cron= CronTab(user='ttmz')
  job = my_cron.new(command='python beddenscraper.py')
  job.minute.every(1)
  
  cron.write()
  </code></pre>
  <p>and that should trigger beddenscraper.py:</p>
  <pre><code>import requests
  from bs4 import BeautifulSoup
  import pandas as pd
  
  scraped_data=[]
  details= {}
  
  
  page=requests.get('https://www.swisssense.nl/bedden')
  soup = BeautifulSoup(page.content, 'html.parser')
  
  products = soup.find_all(&quot;a&quot;, class_=&quot;product-item-link&quot;)
  prices = soup.find_all(&quot;span&quot;, class_=&quot;price&quot;)
  images = soup.find_all(&quot;img&quot;, class_=&quot;product-image-photo&quot;)
  
  
  
  bed_data = soup.find_all(&quot;li&quot;, attrs={&quot;class&quot;, &quot;item product product-item&quot;})# total number of bedden
  
  for bed in bed_data:
      bed_naam = bed.find(&quot;a&quot;, class_=&quot;product-item-link&quot;).getText()
      bed_price = bed.find(
          &quot;span&quot;, class_=&quot;price&quot;
      ).getText()  # print(bed_naam.text, bed_price.text)
      scraped_data.append(
          {&quot;bed_naam&quot;: bed_naam.strip(), &quot;bed_price&quot;: bed_price.strip()}
      )
  
  dataFrame = pd.DataFrame.from_dict(scraped_data)
  dataFrame.to_csv('swisssense.csv', index=False)
  </code></pre>
  <p>so: unfortunatly i get a ton of error messages.
  Also some are using Crontab-e in terminal, or crontab -1.. none work for me so i think im doing something really wrong. Cant really find anything to explain on the web.</p>